If Then and MsgBox ? (1 Viewer)

lorenzoaj

Registered User.
Local time
Today, 10:41
Joined
Nov 26, 2001
Messages
32
1. Is there any way to format a MsgBox? Can I resize the box and change the font?

2. I have created a MsgBox to pop up before the Main form opens up. It gives the user the option to say yes, no or cancel. If the user clicks yes I want the main form to open if they click no or cancel I want to exit the db. Any help will be greatly appreciated.

AJ
 

Jack Cowley

Registered User.
Local time
Today, 17:41
Joined
Aug 7, 2000
Messages
2,639
1. No

2.
Dim Response As Integer
Response = MsgBox("Continue?", vbQuestion + vbYesNo + vbDefaultButton1)

If Response = vbYes Then
Docmd.OpenForm "YourFormName"
Else
DoCmd.Quit
End if

You don't need the Cancel button...


[This message has been edited by Jack Cowley (edited 01-09-2002).]
 

lorenzoaj

Registered User.
Local time
Today, 10:41
Joined
Nov 26, 2001
Messages
32
Jack,

Thanks. It worked but I didn't like that after the user clicks yes or no another box popped up and asked to continue. I just created a form to do to the same thing. I needed a Privacy Act statement before my db opened up. I just used created control buttons Yes and No and with Yes opening the db and No closing.

Is there a way to get rid of the second box coming up and asking Continue? I've looked through help and tried different things but I could not figure it out.

AJ
 

Users who are viewing this thread

Top Bottom