Subforms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that lists a business location in the main form. The subform
lists employees. In each employees record in the subform, I have a field set
that if someone clicks in this field a macro runs, it goes directly to the
individual "Employee Form" for the SS# of the employee the user was just
looking at. However, the macro works fine if I test if directly from the
individual subform (and the main form isn't open). However, if I open the
Main Form that the subform is in, the macro doesn't work.

It's kind of like this:

Main Form Name: [frmLocation]
Subform Name: [frmEmployees(Subform)]
Field Name: [SS#]

Go to Form Name: [frmEmployees]
Field Name: [SS#]

In my macro I have the "Open Form Action" to go to "frmEmployees" where
[ss#]=[forms]![frmEmployees(Subform)]![ss#]

I'M REALLY IN A CRUNCH TO GET AN ANSWER TO MY PROBLEM. HELP WOULD BE
GREATLY APPRECIATED!!!!!!! THANKS, and have a great evening!
 
Hi LMP,

Try this:

[ss#]=[forms]![frmLocation]![frmEmployees(Subform)]![form]![ss#]

where "frmEmployees(Subform)" is the name of the container in frmLocation
that holds your subform. This container may or may not have the same name as
the subform itself.

You will save yourself future headaches if you avoid using special
characters in Access, such as the parenthesis and the # sign, for anything
that you assign a name to. Here is a KB article that discusses this in more
depth:

Special characters that you must avoid when you work with Access databases
http://support.microsoft.com/?id=826763

Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

I have a form that lists a business location in the main form. The subform
lists employees. In each employees record in the subform, I have a field set
that if someone clicks in this field a macro runs, it goes directly to the
individual "Employee Form" for the SS# of the employee the user was just
looking at. However, the macro works fine if I test if directly from the
individual subform (and the main form isn't open). However, if I open the
Main Form that the subform is in, the macro doesn't work.

It's kind of like this:

Main Form Name: [frmLocation]
Subform Name: [frmEmployees(Subform)]
Field Name: [SS#]

Go to Form Name: [frmEmployees]
Field Name: [SS#]

In my macro I have the "Open Form Action" to go to "frmEmployees" where
[ss#]=[forms]![frmEmployees(Subform)]![ss#]

I'M REALLY IN A CRUNCH TO GET AN ANSWER TO MY PROBLEM. HELP WOULD BE
GREATLY APPRECIATED!!!!!!! THANKS, and have a great evening!
 
Back
Top