Response To Message Box

sirmilt
09-04-2003, 11:21 AM
I am thoroughly confused.

I bring up a message box when form 1 is complete, with the following code. When the user makes an entry on form 2, form form 3 should appear

Dim intResponse As Integer

intResponse = MsgBox("Are there any special commission
arrangements for this dealer?", 36, "Commission
Adjustments")
If intResponse = 6 Then
Form2.Show
End If

When I execute the code, the message box comes up fine, the intResponse variable shows 6 but form 2 doesn't show.

I can't see anything wrong with this simple bit of code except that it doesn't work, what did I mess up?

lebb
09-04-2003, 11:24 AM
I don't see any problems there -- perhaps some code in Form2's Load event is causing the trouble?

And why are you using number literals for the MsgBox settings instead of the built-in constants (vbYesNo, etc.)? It makes the code much harder to read and maintain.

Van^
09-04-2003, 11:40 AM
Does Form2 need to be modal over Form1? Put a break point in your Form_Load event for Form2 and see if there is something happening there, like lebb said. You do realize that if Form2 is not modal, then Form1 code continues to execute? Are you cleaning up Form2 somewhere after that? Or exiting the application?

--Van^

passel
09-04-2003, 01:02 PM
Van^ or lebb's idea's are probably more likely, but I thought I'd add
that if Form2's windowstate was minimized, it would only show up on
the task bar, so may not be noticed.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum