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 22nd, 2005, 07:02 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 sub procedure has 2 parameters and no return value, but access says expecting =

I have a sub procedure that has two parameters:
Code:
 Public Sub FieldState(obj As String, state As Boolean)
 	If IsObject(Me(obj)) Then
 		If state = True Then
 			Me(obj).Visible = True
 			Me(obj).Enabled = True
 		Else
 			Me(obj).Visible = False
 			Me(obj).Enabled = False
 		End If
 	End If
 End Sub
 

but when calling the procedure using:
FieldState("field", 0)
i get the error:
Expecting: =

However, I do not get this error with procedures that only have a single parameter.

Any Ideas?

Reply With Quote
  #2  
Old March 23rd, 2005, 10:54 AM
pmcnamee pmcnamee is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 13 pmcnamee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 12 m 52 sec
Reputation Power: 0
Remove the parentheses from the sub procedure call.
Code:
  FieldState "field", 0

insead of:
Code:
  FieldState("field", 0)

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > VBA sub procedure has 2 parameters and no return value, but access says expecting =


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 2 hosted by Hostway
Stay green...Green IT