vba syntax issue

scube

New member
Local time
Today, 13:42
Joined
Jan 16, 2006
Messages
8
Hi All

Apologies, my access is more query based that VBA - but I'm trying to change that!

I have a yes/no box in a table that I wish to perform an 'IF' transaction around but for the life of me can't work out how to access it. e.g., I 'd like code to do somethig like:

If tbl_alpha.yesBox = TRUE Then
sqlstr="something"
else
If tbl_alpha.yesBox = FAKSE Then
sqlstr="something else"
End if

I can't find the right syntax - can anyone help me out please?
Thanks
Scube
 
You're not going to find something like that. A table has many records, therefore the yesBox would apply to many records.. vba is the same as SQL in that sense. You have to search for a particular record (like using the WHERE clause) and retrieve its value.

Then you can build conditions off of that. Search for Dlookup()




If you were doing this with a form instead of a table, your syntax is almost perfect.
 
hmmm... ok that's an interesting point.


thanks - I'll re-consider the approach

Scube
 

Users who are viewing this thread

Back
Top Bottom