Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 21st, 2005, 07:40 PM
helz helz is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 5 helz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 30 sec
Reputation Power: 0
VBA: Trying to use procedure parameter in expression, error within this message :)

hey folks!

thought i'd try and be clever and cut down on static code, lets get some of those dynamic juices flowing!

right, well, what i would like to do is have a sub procedure that i can use to clear the values of a form object. ideally the name of the object should be sent to the procedure through a parameter (if possible)

this is some code that i thought could work

Code:
 Public Sub DelFormObj(obj As String)
 	 Me.[obj].Value = Null
 End Sub
 

the error i get is: Access can't find the field '|' referred to in your expression

I'm new to VB/VBA so any help will be greatly appreciated!

Reply With Quote
  #2  
Old March 22nd, 2005, 10:45 AM
helz helz is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 5 helz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 30 sec
Reputation Power: 0
answer found. (in this forum actually, aint search brilliant!)
turns out that if i want to use a variable in an expression i just have to use parenthesis instead.
Me(variablename).Value
instead of
Me.[variablename].Value

Reply With Quote
  #3  
Old March 23rd, 2005, 03:37 PM
fbobak fbobak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Location: Pennsylvania
Posts: 3 fbobak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 46 sec
Reputation Power: 0
trying to use procedure parameter

I'm having a similar problem and tried your solution but it doesn't work. Any other suggestions?

Thanks

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > VBA: Trying to use procedure parameter in expression, error within this message :)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT