Solved VBA - Command to open a form based on a query

Teri Bridges

Member
Local time
Today, 02:30
Joined
Feb 21, 2022
Messages
187
My form is based on a query. I need to build code that requires two conditions to be met in order to open another form.

I need the catalogID and The event ID in my open form command. i do not know how to do more than one condition.
I have this

1697836829411.png
 
There is something not right about what you have now. So, I'm going to give you the solution for the DoCmd.OpenReport method.

This is what the WHERE argument would look like if you use VBA.

"CatalogID = " & Me. CatalogID & " AND EventID = " & Me.EventID

PS - ALWAYS make sure you save the current record BEFORE you open a new form or a report or query.
 
Would really be better off learning vba.
 
Would really be better off learning vba.
yes, I am trying. I map in my mind what I want it to do, then I try and get it to work with macro, so I can get a basic visual, and then I try VBA. Sorry for any trouble.
 
As a learning method, you could try to build your macros then convert them to VBA to at least get a feel for what they should should look like. The macro-to-VBA conversion is not the prettiest in the world, but for teaching methods it might be helpful.
 
There is something not right about what you have now. So, I'm going to give you the solution for the DoCmd.OpenReport method.

This is what the WHERE argument would look like if you use VBA.

"CatalogID = " & Me. CatalogID & " AND EventID = " & Me.EventID

PS - ALWAYS make sure you save the current record BEFORE you open a new form or a report or query.
 

Users who are viewing this thread

Back
Top Bottom