Solved VBA - Command to open a form based on a query (1 Viewer)

Teri Bridges

Member
Local time
Today, 00:24
Joined
Feb 21, 2022
Messages
186
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
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:24
Joined
Feb 19, 2002
Messages
43,275
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.
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:24
Joined
Sep 21, 2011
Messages
14,299
Would really be better off learning vba.
 

Teri Bridges

Member
Local time
Today, 00:24
Joined
Feb 21, 2022
Messages
186
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.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 00:24
Joined
Feb 28, 2001
Messages
27,186
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.
 

Teri Bridges

Member
Local time
Today, 00:24
Joined
Feb 21, 2022
Messages
186
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

Top Bottom