Form opened by another form

Edwinq

Registered User.
Local time
Today, 14:54
Joined
Apr 8, 2010
Messages
25
Hi,

Is there a way to check how the form was opened ??

meaning:
From form "main" I open up form "sub" with command
docmd.openform(sub"),,,,acDialog

WHen the sub form is open, can i check if it was opened by form Main ?

thanks in advance
Edwin
 
Only if you pass that to the form at the time. You would have to include it in the OpenArgs

DoCmd.OpenForm "sub", WindowMode:=acDialog, OpenArgs:= Me.Name


Then you get the value when sub is open in the code for sub by using

Code:
Dim strFormOpenedBy As String
 
If Me.OpenArgs <> vbNullString Then
   strFormOpenedBy = Me.OpenArgs
End If
 
Worked great for me !

Thanks a lot

edwin
 

Users who are viewing this thread

Back
Top Bottom