How do I go directly to a sub-swichboard on clicking OK in a msg b

R

Rachael

I have a swichboard where the first step is to pick the region you want data
for.
Then it pops up a message saying that the region has been set for all
subsequent reports.

My question is...how can i set it so that the "Main Report Menu" opens when
the user selects <OK> on the message box rather than the message box just
closing and the user has to navigate to the Main Report menu?

THANKS!!

here is my code so far:

Public Function FunctionRegion2()
DoCmd.SetWarnings (0)
DoCmd.RunSQL ("UPDATE CompanyRegion SET CompanyRegion.[Select] = False")
DoCmd.RunSQL ("UPDATE CompanyRegion SET CompanyRegion.[Select] = True WHERE
((CompanyRegion.RegionID)=2)")
DoCmd.SetWarnings (-1)
response = MsgBox("Region Has been Set to NORTHWEST. Select 'Goto Reports
Main Menu' to Select Reports.", vbOKOnly)
 
D

Daryl S

Rachael -

Since the user's only option is to click OK, you can just add the following
code after the "response = ..." line:

DoCmd.OpenForm "formname"

where you put your formname in quotes, and include any of the other options
as needed (e.g. filter, view mode, etc.).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top