Accessing subforms

  • Thread starter Thread starter Sam Hobbs
  • Start date Start date
S

Sam Hobbs

I have a form with two subforms and I need the first subform to be able to
access the second subform.

First, I am not sure what the purpose of this newsgroup is, but I hope my
question is appropriate.

What I am doing is very similar to the Customer Orders form of the
In that, the OnCurrent event of the form in the first subform does:

Me.Parent![Customer Orders Subform2].Requery

That won't work for what I am doing, since the data for the second subform
does not exist as a table or query. So using the

as an example, how would the ProductName textbox in the second subfrom be
accessed from (OnCurrent event of) the first subform? I assume it is just a
matter of knowing the syntax, and if so then that's what I can't figure out.

I am more familiar with the C++ language, and if I were doing this in C++, I
would create a class for the subforms. I could call a function (method) in
the second form from the first form to do what I need to do. If that is a
good solution with Access Basic also, then any hints will be appreciated.
 
Ooops, sorry. I got distracted by a few things and forgot I was going to put
in the "Northwind sample database".


Sam Hobbs said:
What I am doing is very similar to the Customer Orders form of the

insert here: Northwind sample database
In that, the OnCurrent event of the form in the first subform does:

Me.Parent![Customer Orders Subform2].Requery

That won't work for what I am doing, since the data for the second subform
does not exist as a table or query. So using the


insert here: Northwind sample database
 
Sam Hobbs said:
I have a form with two subforms and I need the first subform to be able to
access the second subform.

I figured it out.

The main problem was that essentially nothing works in the first OnCurrent
event; the one that occurs during OnLoad I assume.
 
Back
Top