Subform Issue

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

Guest

I had a subform in a form. The subform has a check command to set value
(date and user) for two fields in the subform. If I open this form and click
in the check command it works just fine but if I close the form and load it
again using an open form command bottom, I received an error (The expression
you enter refers to an object that is closed or doesn't exist.

Can anyone help me please !
 
I had a subform in a form. The subform has a check command to set value
(date and user) for two fields in the subform. If I open this form and click
in the check command it works just fine but if I close the form and load it
again using an open form command bottom, I received an error (The expression
you enter refers to an object that is closed or doesn't exist.

Can anyone help me please !

I'm guessing that this "check command" is either VBA code or a
macro... right?

If so, please post the code. You have an invalid reference, but
without seeing the code I can only guess what that reference might be.

One guess: if it works when you open the subform directly as a Form,
you may be referring to Forms!subformname!controlname in your code.
That doesn't work for subforms, since the subform is not open in its
own right and is not part of the Forms collection. You must navigate
via the mainform, using the Name property of the Subform control:

Forms!mainformname!subformcontrolname.Form!controlname

John W. Vinson[MVP]
 
It's a macro with the SetValue action and [Forms]![Attendance Querry
subform]![Hora atendido] in the item field and "Time() in the expression
field. Same code with [user].
 
It's a macro with the SetValue action and [Forms]![Attendance Querry
subform]![Hora atendido] in the item field and "Time() in the expression
field. Same code with [user].

Use instead

[Forms]![mainformname]![Attendance Querry subform].Form![Hora
atendido]


John W. Vinson[MVP]
 
Back
Top