Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form to be DIALOG using VBA and objects

Status
Not open for further replies.

trash00

Programmer
Jul 29, 2002
5
SK
The problem is: I have a modal+popup form which i want to show as a DIALOG form, so I can handle value passed to parent form upon exiting this form.

Normally I open a form to be DIALOG as docmd.openform form_name, ...., windowmode:=acDialog

But how can I achieve this in VBA using object? I goes like this:

Dim frm As Form
Set frm = New Form_frmCustomers
frm.Visible = True

But no there's no property that could make for me that what i want. Even the Popup property can't be changed.
 
Hiya,

You obviously come from a VB background. So do I.

Access isn't VB - you have to work with Access to make it 'become' VB.

What properties of the Dialog do you want to use that you don't have access to in MS Access?

Passing parameters to it perhaps? What do you want the dialog to do?

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
OK, let's explain some more:

The child modal form returns a value to the parent form. The child form has to be opened with windowmode:=acDialog, so the code stops execution after docmd.openform ... line and waits until the child dialog form closes.

until i put there that acDialog param, after loading the child form i COULD change some objects in the child form after opening it (fill some textboxes on the child form from the parent form), because the execution wasn't paused (the sub in parent form ran to the end - didnt wait for the child to close). but NOW i CAN'T set those values in the child form before "docmd.openform" because the form isnt loaded and neither after DOCMD, because the execution after DOCMD waits until the child closes.

So I THOUGHT i can set up the FORM using OBJECTS, but I cant force this crappy **$#*$^%#* to open the form as DIALOG.

Is this whole M$ Access a complete fusion of ^&$#%^&*@@*?!?
The more I know about this *^#$% the worser i live. A crippled evolution software.

"Each M$ product is a mix of something strange from the past and some innovations that make together a FRUSTRATIVE MONSTER."
 
DoCmd.OpenForm "DialogFormName", , , , , acDialog

I guess you'll need some public variables in a module and set their values before opening the dialog form.
You can use the Open or Load event of the dialog to fill in the text boxes from the variables, then the Close event to pass other values that you may need when resuming 'parent' form code execution...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top