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)

0
Utf
11/30/2009 3:24:01 PM
access.forms 6864 articles. 2 followers. Follow

1 Replies
496 Views

Similar Articles

[PageSpeed] 21

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)
> 
0
Utf
11/30/2009 6:05:01 PM
Reply:

Similar Artilces:

cant view columns ie A B C D..
This is driving me nuts but I am sure it's an easy setting, I cant see to view the top of my spreadsheet to see the excel column names ie A C Sorry for being thic -- beatrice2 ----------------------------------------------------------------------- beatrice25's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3450 View this thread: http://www.excelforum.com/showthread.php?threadid=55476 Hi, Can you see the row numbers? If not then try Tools -> Options -> View and under Windows Options maybe you have to tjeck-mark the Row & Column Headers. Regar...

How do I re-direct my current e-mail address through outlook???
I cannot send or receive any e-mails using outlook. I have set up my account but it still won't send or receive e-mails. Hello TomLock, you wrote on Thu, 18 Aug 2005 12:16:56 -0700: > I cannot send or receive any e-mails using outlook. I have set up my account > but it still won't send or receive e-mails. Do you receive any error messages? -- Best Regards Christian Goeller ...

How to I go about this!
I have a continuous form that shows all my Invoices (Records) but after 3 years the records 2800 takes a few seconds to load up each time I open the form,The Row source is qryClient, but I have created another qryClientOneYear which sorts my records to the last year, My question is how do I create a toggle so as I can choose which query I would like to run in my continuous form? simply change the form's RecordSource property from one query name to the other. exactly how you do that depends on whether you want to choose *before* opening the form (from another form), or while the ...

Why when I go to sort does it automatically highlight from #1028?
I now have Microsoft 2003. When I go to data, then sort it always highlights from #1028 but I want to sort the whole chart. I can't manage to find the 'select all' button and surely I don't have to manually highlight the whole thing !! Ruth To quickly select the entire table, press Ctrl + * If the entire table isn't selected when you use this shortcut, perhaps there's a blank row somewhere in the table. Ruth wrote: > I now have Microsoft 2003. When I go to data, then sort it always highlights > from #1028 but I want to sort the whole chart. > > I ...

Outlook box pops up and won't go away; wants disk inserted
>A Microsoft Office Outlook box keeps popping up whenever I go to do >anything on my computer. AND it won't go away. It really never opens, it >just has lots of windows with errors on it that keep popping up. It >started when I went to send some Real Estate docs from one of my Real >Estate programs. I can't get rid of it and I can't send my documents with >my >Real Estate program. Had to print all the docs out and rescan them back >into the computer and then send them as an attachment. I have never opened >the Microsoft office outlook. I do use outloo...

Reassociate msg attachment with outlook
I have both Outlook 2000 and GW 6.5.1 installed and I use both programs. Whenever I try to open an email that has an attached email with .msg or ..msg.msg extension from within Outlook, GW starts up and the attachment never opens. I recently upgraded to 6.5.1 from an earlier version and I didn't have the problem prior to the upgrade. For example, when opening emails (in Outlook) that were attached to other emails, GW would not open, rather, the attached messages would open and display correctly in Outlook. The only workaround I have for the current problem is to save the attached *.msg t...

Please, help for the Error msg 214 MSSQL2005
I am using code below: DECLARE @SQL NVARCHAR(1000), @ParmDefinition VARCHAR(100) SET @ParmDefinition = N'@loginname varchar(30)' SET @SQL = N'select * from tUser where loginname=@loginname' EXEC sp_executesql @SQL, @ParmDefinition, @loginname = 'admin' But this code returns Error numbered 214! I need to use sp_executesql through the parameters like above. But this sends an error. What should I do? Please help me, guys! Orgil Both the @stmt and the @params parameters of the sp_executesql procedure must be unicode, but you declared the variable that yo...

How to get notified of window close button click..
Hi, I have a CDialog derived class.. I am creating by making its object, and using Create method with various parameters. Then upon condition of my application, I am using ShowWindow method of dialog to show and hide the window. Now, I want to get notified of window close event.. So, which function (virtual function or window message handling) should I use to get notification of window red cross mark click ? Jigar I got that notification by using WM_CLOSE message.. Look at OnClose/OnCancel. ---------- Ajay Kalra ajaykalra@yahoo.com OnClose() will get called if they click the "red...

UAC "OK" button greyed out
Suddenly the "OK" button on UAC is unlit and I can't press it. I can't disable UAC because the screen pops up prompting me to press OK or Cancel, but OK isn't lit. Same thing if I try to change my user account type (which is administrator), when I try to use "elevated command), when I try to access msconfig, and when I try to run system restore. Basically, we can't do anything because the OK button is never available to be clicked on! :cry: I am completely out of ideas! I should have disabled the annoying thing years ago! Thanks for you help! ...

=?iso-2022-jp?B?GyRCI1AbKEJhaW50Lk5FVA==?=
Env: XP, VC++6.00 I wonder how to create a icon(something like "+" with flicker effect) just like the icon of "TEXT input" inside Paint.NET. I know Paint.NET is made by .NET, but I want to know how to do by VC++6.00. TIA ou Havent used Paint.Net, but you can use CAnimateIcon: http://www.codeguru.com/cpp/w-d/doc_view/titlebar/article.php/c3281/ Also some graphics file formats allow animation. That may be simpler. -- Ajay "ou" <ou07@ab.auone-net.jp> wrote in message news:elqqA%2392IHA.2424@TK2MSFTNGP04.phx.gbl... > Env: XP, VC++6.00 > > ...

OWA http re-direct
Hello All: Does anyone know why http://mail.mydomain.com/exchange does not re-direct to https://mail.mydomain.com/exchange ? Instead it gives me a 403 error forbidden. Please help! Best, Rick "Rick" <Rick@discussions.microsoft.com> wrote: >Does anyone know why http://mail.mydomain.com/exchange does not re-direct to >https://mail.mydomain.com/exchange ? Why would you expect it to do that? Those are two different port numbers but the same virtual directory. >Instead it gives me a 403 error forbidden. When you use the /Exchange virtual directory you're real...

OK, I give up, what's a good book?
"Upgrading" to Office 2007 has been one of my worst experiences that didn't involve any threat to life or limb. Is there a Reader's Digest category for that? So, I guess I better do some studying. Can anyone recommend a good book for users of previous versions of Office to try and make sense of all the garbage on my screen and and clues to where the geniuses at M$FT have hidden all of the useful icons and options that I have been using for years? I prefer something not from M$FT as I don't like to further reward bad corporate behavior. I probably need a general Office...

6MB msg. stuck in Outbox,tried help method, to cumbersome-ideas?
6MB msg. stuck in Outbox,tried help method, to cumbersome-ideas? "DeLoy" <DeLoy@discussions.microsoft.com> wrote in message news:6D2AC4BE-5044-42D6-8F86-CCE55F79534D@microsoft.com... > 6MB msg. stuck in Outbox,tried help method, to cumbersome-ideas? Click File and check Work Offline. Stop and restart Outlook. Delete the message. Click File and uncheck Work Offline. -- Brian Tillman [MVP-Outlook] ...

How to enable a window by mouse click?
Hi, In my program, a MDI program, I have a disabled view. I want to enable it when user clicks the view. I put EnableWindow in CChildFrame::OnMDIActivate(...) . It works. But I always get a 'Ding' noise when click the disabled view. Is there a way to remove the 'Ding' noise or I shall enable the view by other means? Thanks Jeff ...

VBA code to go to a bookmarked drop down goes to wrong drop down
I am using vba code to perfprm a variety of tasks; the code is working fine, except, the last action before re protecting the form is to go to a specific bookmarked drop down 'byelaw1' but it goes to 'byelaw2' instead: Sub Onexitclassification() If ActiveDocument.FormFields("pclassificationDD").Result = "CASB(B)/ Offences against park byelaws" Then ActiveDocument.FormFields("Classificationtext").Result = "(In accordance with the LBS 'Byelaws for Pleasure Grounds, Public Walks and Open Spaces' November 2008)" ActiveDocument.Unp...

Closing messages by right-clicking with mouse.
Is there a way to set up my mail so I can close a message by double right-clicking with my mouse? no. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Subscribe to Exchange Messaging Outlook newsletter: EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM "reyer...

Sub BUandSave2()
how can i adapt the following macro to run when you exit the workbook instead of when i save. Sub BUandSave2() Application.DisplayAlerts = False ActiveWorkbook.SaveCopyAs Filename:="T:\Invoices\Batch Book" & _ ActiveWorkbook.Name ActiveWorkbook.Save Application.DisplayAlerts = True End Sub thanks mark hi, Put the code in the on close event of the thisWorkbook module. >-----Original Message----- >how can i adapt the following macro to run when you exit >the workbook instead of when i save. > >Sub BUandSave2() > Application...

Right Click on Mouse doesn't work in Excel 2003
I have tried installing the office twice with same result. I am not able to set properties or insert cells using right click on the mouse, seems like it is disabled. It works with other office packages and I can change properties on sheet name in excel. Is there a setting where this feature is disabled? Hi what exactly does happen: - do you see a context menu - are the options greyed-out - etc -- Regards Frank Kabel Frankfurt, Germany "Raghu" <anonymous@discussions.microsoft.com> schrieb im Newsbeitrag news:1357f01c443ff$bdd87ea0$a301280a@phx.gbl... > I have tried in...

second try
We're using Exchange 2007 Standard Server. Is there anyway to configure a global out of office reply message directly on the Exchange server, so that if message is received on that server it will automatically reply with an "out of office due to inclimate weather message"? We don't want to do it on individual email accounts. We want it to apply to the server. Most of the users have already gone home and do not have the means to put a message on their individual outlook mailboxes. Also, if i am able to only put the message on the server itself, then i'll only...

Why Does Mortgage And Loans Go To Ads?
Why when I press the Mortgage And Loans tab, it doesn't go to my mortgages and loans, but displays a page that asks me to "Find a mortgage loan that's right for you"? This is just crazy... I mean, these programs used to be useful, but they are just becoming ads for financial services. Is there any way to change this so that by clicking on Mortgage and Loans tab I actually get a listing of my Mortgage and Loans? If not, is there a financial program out there that manages your finances, minus the constant pitches for 'financial services'? Some people find Q...

How to move a sub window to full screen?
hi,all I have a problem in my c++ 6.0 app. I want to full screen a couple of windows. I just get the rect of desktop and call MoveWindow() to move my main app window to full screen. This is no problem. But when I did the same thing in a sub/child window, it is different. ::GetWindowRect(hDesktop, &rect);//rect.top = 0 , rect.bottom=768 ScreenToClient(&rect); //rect.top = -44, rect.bottom=724, left=-6, right=1018 //Here, I think it should be rect.top = -28, the title height. Why is it -44? MoveWindow(rect);// After that, we can not see the window title. So, how to convert this ? Tha...

Create new SMTP Sub Domain
when i create a new SMTP sub domain, in order not to verify every incoming mail for crm links, specifically for my crm mails, can i then use my existing exchange server to handle this domain? or do i have to install a new exchange server? and if i can use my existing exchange, how do i then configure my router to only verify mails coming in my new crm subdomain (and not all mails coming in my exchange environment)? thx ...

How can I view all contacts for all sub-accounts of accounts?
I have an account with more sub-accounts. Each sub-account has one ore more contacts. Normally I can see only contacts associated directly with that account, not with sub-accounts. When a select that parent accounts, I'd like to see all the contacts from all sub-accounts. It is possible ? That is the current v4.0 Out of Box functionality. The relationship is there, so building a SRS report is a good option for this. Or SDK... Good luck. Frank Lee, Microsoft CRM MVP http://microsoft-crm.spaces.live.com http://www.workopia.com/Links.htm "Paul P" wrote: > I have an ...

"Items to review " number will not go away (stuck)
I have been using the internet update option to download transactions. I have been able to review all items until my last download. Now I have (7)items to review but really I do not. How do I reset the Items to review. I have Money2003 In microsoft.public.money, Gary wrote: >I have been using the internet update option to download >transactions. I have been able to review all items until >my last download. Now I have (7)items to review but >really I do not. How do I reset the Items to review. I >have Money2003 In Internet Explorer delete your browser temporary files...

How do I define column C so C(n) =A(n)+B(n)
I want to create a spreadsheet where some cell entries are mathematical functions of data in corresponding cells (same row) of other columns. For example, assume fixed data in columns A and B. In column C, I want C(1) to = A(1) + B(1) etc. Hi in C1 type =A1+B1 then move your cursor over the bottom right hand corner until you see a + (known as the autofill handle) hold the left mouse down and drag down the column as far as you need to go and let go, the formula will be filled in for you for each line Cheers julieD "S M Raucher" <S M Raucher@discussions.microsoft.com>...