If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How do I go directly to a sub-swichboard on clicking OK in a msg b
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) |
#2
|
|||
|
|||
How do I go directly to a sub-swichboard on clicking OK in a msg b
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.). -- Daryl S "Rachael" wrote: 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) |
Thread Tools | |
Display Modes | |
|
|