I want to know which form control has come from.

S

Stapes

Hi

I want to pass the name of my calling form along to the next form. The
values displayed will vary according to which form control has come
from. Any ideas how this can be done?

Stapes
 
6

'69 Camaro

Hi, Steve.
I want to pass the name of my calling form along to the next form.

Use the OpenArgs parameter of the OpenForm method to pass a string (in this
case, the name of the form that opens the other form) to the form you want
to open. In the opening form'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.
 
F

fredg

To open the second form, use:
DoCmd.OpenForm "FormName", , , , , , Me.Name

Note: You should substiture your second form's name where I have "FormName",
using the quotes as I have them.
Me.Name should be written exactly as I wrote it.

In the second form's Load event, code:
If Not IsNull(Me.OpenArgs) Then
Dim strFormName as String
strFormName = Me.OpenArgs
End If
 
Top