Problem with subform in Access 2003

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

Guest

I understand similar questions have been asked before, however, searching the
forum has not yielded a solution to the problem at hand. We have a
form-based application converted from Access 97 to 2003, now, for some
reason, a call/control (please ignore the terminology for now) from the
subform failed to update/populate a field in the main form.

While trying to isolate the problem by going to the subform's design view,
I noticed that its Default View is set to Single Form, and I read somewhere
that the Default View needs to be set to Continious Forms to ensure its
interaction with Main Form, however, my attempt failed, Access complained
that "You can't view a form as a continous form if it contains a subform, an
ActiveX Control or a bound chart". So, another question, how can I determine
if this subform has subform(s) of its own? And how do I know if it has
ActiveX control ...?

Running the subform (a separate form) , I got the following error,

Run the sunform got the following err msg:
"
Run-time error: 2450

The app system can't find the form 'frmMyMainForm' refered to in a macro
expression or Visual Basic code.

End or Debug
"

Then, when I got into debugging mode,
the following line is highlighted
Forms!frmMyMainForm.Text344 = cmbSubFormFieldA

Should I use the fully qualified name for 'cmbSubFormFieldA'?
And is it "mySubFormName.cmbSubFormFieldA"?

I would truly appreciate some patient and meaningful help (not too much
about semantics), thanks.
 
Iy makes no difference which view the subform is. All view work with the
main form.

"frmMyMainForm" appears to be a placeholder for the main form's name.

To refer to a main form from a subform, use the syntax:

Me.Parent

or

Forms!MainFormName

where MainFormName is the placeholder for your main form's name.

To refer to a subform from a main form:

Forms!MainFormName!NameOfSubformControl.Form!NameOfAControlOnTheSubform

or

Me.NameOfSubformControl.Form!NameOfAControlOnTheSubform
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
I appreciate your explanation, however, problem persists.
In the subform, event = AfterUpdate
It has the following lines within the Sub for ControlA
cmb_subform_FieldB.Requery
' I just added the following line to try to requery the main form's fieldB
Forms!frmMyMainForm.mainform_FieldB(ControlB).Requery
' it does not work neither
' when I ran debug, it complained can't find frmMyMainForm referred to
' how weird?
errorName.Value = cmb_subform_FieldA
Forms!frmMyMainForm.mainform_FieldA = cmb_subform_FieldA(ControlA)
I changed the above line to
Forms!frmMyMainForm.mainform_FieldA =
Forms!frmMyMainForm.SubFormObjectNameOrControlName!cm_subform_FieldA(ControlA)
to no avail either.

Though when fieldA is selected, Access status indicated calculationg ...
query ...
not producing resultset or displaying though

And when I tried to test the subform and feeded with parameters/prompts such
as date, quote number etc. the second field data did show up (query did
produce resultset), somewhere I read mention about making sure the field name
in Master form correspond to its peer in the subform, how do I verify that?

Thanks.
 
Once again from the main form the reference is:

Forms!MainFormName!NameOfSubformControl.Form!NameOfAControlOnTheSubform

breaking it up:

Forms!
MainFormName! (the name of the main form)
NameOfSubformControl (the name of the subform control)
..Form!
NameOfAControlOnTheSubform
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

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

Similar Threads


Back
Top