Problem with acDialog

Skip Bisconer

Who Me?
Local time
Today, 13:40
Joined
Jan 22, 2008
Messages
285
I am using this code on a form command button click event trying to make the form disappear while I open another form based on a query. I thought the acDialog was supposed to suspend the code until the new form closes. Maybe I just have it incorrectly placed. Please take a look and advise me.

Private Sub Command23_Click()
On Error GoTo Err_Command23_Click
Me.Visible = False
DoCmd.OpenForm "frmViewAssignedOrdersProgress", acFormDS, , , acNormal, acDialog
DoCmd.Maximize


Me.Visible = True

Exit_Command23_Click:
Exit Sub

Err_Command23_Click:
MsgBox Err.Description
Resume Exit_Command23_Click

End Sub
 
Try:
DoCmd.OpenForm "frmViewAssignedOrdersProgress", acFormDS, , , , acDialog
 
Thanks for responding. Thats the way I had it first, but what happens is the new form comes up minized with no restore buttons just close and the original form comes right back. I plugged in maximize but the orginal form keeps coming back.
 
What happens when you open the frmViewAssignedOrdersProgress form directly from the database window?
 
It opened the same way so I took a look at that on load event and I had a function to minimize the switchboard form. So I dumped that and what happens now is the code still doesn't pause as the first form comes right back out front. MS help said the popup had to be modal; I tried that, but either way it does the same thing.
 
acDialog forces the next form to PopUp and Modal and the Modal does not return control to the calling form until the form closes or is set invisible.
 
I can't get it to work for me. I will have to try another way around the problem. Thanks for your suggestions.
 
Something else is going on Skip. If you want to post your db, maybe someone here can see what is wrong.
 
Do you have this posted elsewhere, Skip? Reason I ask, I just answered an identical question a day or two ago. The problem is, you can't open a form in DataSheet view, like you're doing here, and also open it in Dialog mode. That's just one of the many things that Access won't allow when working with a DataSheet form.

I suspect (but haven't tested) that the nearest you can come would be to try the Continuous view form made to look like a DataSheet view form, and see if that'll open in Dialog mode.
 
I think that is the problem. What I have done is went about docmd.close on the calling form and docmd.openform on the popup close event. Isn't as slick as I woud like but it works. Thanks for all your help. I am on to other problems of my own making.
 
The problem is, you can't open a form in DataSheet view, like you're doing here, and also open it in Dialog mode. That's just one of the many things that Access won't allow when working with a DataSheet form.
Thanks Linq! There is something new to learn every day.
 

Users who are viewing this thread

Back
Top Bottom