By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,776 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,776 IT Pros & Developers. It's quick & easy.

How do I creeat a pop up warning?

P: 1
Access 2002

I'm wondering if anybody could help me figure out how to add a warning to an access database.

Here's my issue:
I have 2 databases that users will enter into, one is for 2006 data and the other is for 2007 data. What I would like to happen is for when the users open the 2006 datbase a warning pops up before the main menu that states "Please note that you are in 2006 database". After clicking the ok button it will bring them to the main menu form.

I have already changed the titles and colors to reflect the new year, but I would like to have one more fail safe so that they have to click the warning off to get into the old database.

Thank you in advance for your help!

-illusionone
Jan 10 '07 #1
Share this Question
Share on Google+
2 Replies


P: 36
Put this code where your opening the form:

Expand|Select|Wrap|Line Numbers
  1.     Dim intMsg As Integer
  2.     intMsg = MsgBox("Please note that you are in 2006 Database." & _
  3.         " Do you want to continue?", vbQuestion + vbYesNo + vbDefaultButton2, "Please confirm")
  4.  
  5.     If intMsg = vbYes Then
  6.         'Open your form here
  7.     Else
  8.         'its up to you
  9.     End If
HTH,
George



Access 2002

I'm wondering if anybody could help me figure out how to add a warning to an access database.

Here's my issue:
I have 2 databases that users will enter into, one is for 2006 data and the other is for 2007 data. What I would like to happen is for when the users open the 2006 datbase a warning pops up before the main menu that states "Please note that you are in 2006 database". After clicking the ok button it will bring them to the main menu form.

I have already changed the titles and colors to reflect the new year, but I would like to have one more fail safe so that they have to click the warning off to get into the old database.

Thank you in advance for your help!

-illusionone
Jan 11 '07 #2

NeoPa
Expert Mod 15k+
P: 31,489
George's code (or something along similar lines doctored for your exact situation) would be within the OnOpen event of the main form you refer to.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2. '...George's code in here
  3. End Sub
Jan 12 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.