
Originally Posted by
Carmine
I’m just attempting to learn Access VBA. So here’s the problem:
I want to set up an IF-Then statement to evaluate the contents of a field in a table.
Table name is: MasterTable
Field name is: Option
The value of Option is 1,2, or 3
What I’m trying to do is execute the following If-Then statement:
If option=1 then open a query
This is to be executed on a button click
Below is what I’ve done, but it doesn’t work. I get Run Time Error: 424
Object required.
Private Sub Command9_Click()
If MasterTable.Option = 1 Then DoCmd.OpenQuery "GallonUpdateQ"
End Sub
Thanks