opening form as dialog

R

Roy Goldhammer

Hello there

If i opened form frmDlg as dialog. How can I get pointer to form that open
frmDlg?

for example:

if on frmMain in some button there is code like this:
docmd.openform "frmDlg", WindowMode:=acDialog

and there is another form frmSec with button and code:
docmd.openform "frmDlg", WindowMode:=acDialog

how can i know in frmDlg which form opened frmDlg?
 
6

'69 Camaro

Hi, Roy.
how can i know in frmDlg which form opened frmDlg?

Use the OpenArgs parameter of the OpenForm method to pass a string (in this
case, the name of the form that will open frmDlg) to the form you want to
open. In frmDlg's OnOpen( ) event, check the form's OpenArgs property for
the string passed to it. If you need help with the code, an example is in
online Help in the OpenArgs topic.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
R

Roy Goldhammer

Whell Camaro:

This I already know, but it can't be happen becaues i'm using openArgs for
diffrent issue

Is there a way to do it without using OpenArgs?
 
6

'69 Camaro

Hi, Roy.
This I already know, but it can't be happen becaues i'm using openArgs for
diffrent issue

I wouldn't buy that argument, even if you explained that's how you _always_
do things: You bought one car to travel to and from work, another car to
take the kids to school, another car to bring the groceries home, another
car to shop with, et cetera. OpenArgs and a car are both multipurpose, so
using either of these for only one purpose is rather wasteful.
Is there a way to do it without using OpenArgs?

What's stopping you from assigning multiple values in the OpenArgs parameter
and separating the values in the string with a comma? After the form opens,
extract any of the multiple values in the string with a function that you
can copy from the tip, "How to get individual items passed to another form
using OpenArgs," on the following Web page:

http://www.Access.Qbuilt.com/html/vba4.html

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top