A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old November 30th, 2009, 03:24 PM posted to microsoft.public.access.forms
rachael
external usenet poster
 
Posts: 78
Default 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  
Old November 30th, 2009, 06:05 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.