Show form modal???

pdbowling

Registered User.
Local time
Today, 18:39
Joined
Feb 14, 2003
Messages
179
Hi all,
I'm trying to, at a button click, show another form with a yes and no button on it. Have the user click one and then the form needs to go away and return focus to the parent.... what is wrong with my code. The form just flashes on and is immediately gone.
Thanks everyone.
PB


Private Sub Command54_Click()

Form_frmReminder.SetFocus
Form_frmReminder.Visible = True

If (Form_frmReminder.myAnswer) Then 'a boolean
Form_frmReminder.Visible = False
doYesterday 'a sub previously written
Else
Form_frmReminder.Visible = False
End If

End Sub
 
Regardless of the value of MyAnswer you are setting the forms visible property to false. That is why it just flashes on the screen and dissapears.
 
Yes

I understand that, I was just under the impression that the code was supposed to ... wait.... while the other window was in focus..... I guess I am wrong.

I'll try moving the if then to the button_clicks on the form.
Thanks
PB
 
If you open the form from code then you can use:
DoCmd.OpenForm "MyForm", , , , , acDialog

then the code will wait until MyForm is closed
 
Whew!!

Gee god, thank you.
I thought that was an easy question.
The differences between VB and Access VB are subtle but quite important.
Many, many thank yous.
PB
 

Users who are viewing this thread

Back
Top Bottom