Selecting a Specific Record Form from a subform

D

Dave Gregory

I have a form with a subform that I want to select a field from and have it
open another form with the data selected from the

sub form.

I was able to get the operation to work in the subform using the following:

Under Parameters of the first field of the subform -- Open4Edit_StationInfo

Open4Edit_StationInfo used the following command:

FindRecord

Find What: =[Forms]![Station Info Subform]![Call Sign]
Match: Whole Field
Match Case: No
Search: All
Search As Formatted: Yes
Only Current Field: No
Find First: Yes

The above works when I run the form "Station Info Subform"

However when I run the Form containing the Subform I get the following
message:

"Microsoft Office Access can't find the form 'Station Info Subform' refered
to a macro expression or Visual Basic

Code.

* The form you referenced may be closed or may not exist in this database.
* Microsoft Office Access may have encountered a compile error in a Visual
Basic module for the form"


The Database contains a couple of separate forms -- one is the information
of a parent company or corporation and another is

the information of an individual radio station. The link between the two
tables is the Name of the parent company. The

relationship is a one to many because one company can own several stations
and they often get sold so the information of the

two tables changes a from time to time as stations change hands but the
basic info in each table doesn't change. The ide is

to link the one table so that the station table can get edited easily.

The main form relates to both tables with the corporate table being the
"dominant" one and the subform being the one refering

to the station.

I need to select the proper record in the station table and bring it up in
it's complete when I double click on it's call

sign in the subform. (Each record in the station table is unique based on
the call sign.)

Thanks,
 
D

Dave Gregory

Thank you. The info was exactly what I needed. Sorry for taking so long to
let you know.

Dave

Douglas J. Steele said:
Subforms are not part of the Forms collection. To refer to them, you must go
through the parent form. And when you're doing that, you're actually going
through the subform control on the parent form:

Forms!NameOfParentForm!NameOfSubformControlOnParentForm.Form!NameOfControlOnSubform

(apologies for the word wrap)

Depending on how you added the form as a subform, the name of the subform
control may not be the same as the name of the form being used as a subform.

You might be interested in http://www.mvps.org/access/forms/frm0031.htm at
"The Access Web"

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dave Gregory said:
I have a form with a subform that I want to select a field from and have it
open another form with the data selected from the

sub form.

I was able to get the operation to work in the subform using the
following:

Under Parameters of the first field of the subform --
Open4Edit_StationInfo

Open4Edit_StationInfo used the following command:

FindRecord

Find What: =[Forms]![Station Info Subform]![Call Sign]
Match: Whole Field
Match Case: No
Search: All
Search As Formatted: Yes
Only Current Field: No
Find First: Yes

The above works when I run the form "Station Info Subform"

However when I run the Form containing the Subform I get the following
message:

"Microsoft Office Access can't find the form 'Station Info Subform'
refered
to a macro expression or Visual Basic

Code.

* The form you referenced may be closed or may not exist in this database.
* Microsoft Office Access may have encountered a compile error in a Visual
Basic module for the form"


The Database contains a couple of separate forms -- one is the information
of a parent company or corporation and another is

the information of an individual radio station. The link between the two
tables is the Name of the parent company. The

relationship is a one to many because one company can own several stations
and they often get sold so the information of the

two tables changes a from time to time as stations change hands but the
basic info in each table doesn't change. The ide is

to link the one table so that the station table can get edited easily.

The main form relates to both tables with the corporate table being the
"dominant" one and the subform being the one refering

to the station.

I need to select the proper record in the station table and bring it up in
it's complete when I double click on it's call

sign in the subform. (Each record in the station table is unique based on
the call sign.)

Thanks,
 

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

Top