Subform combo box selection

A

ajw

I have a subform that has several combo boxes on it. The
main form is frmLocations, the sub form is in control
subControl named subfrmCommLines. I want to have one of
the combo boxes datasource to be controlled by two of the
other combo boxes on the subform. The combo box is filled
with whatever the first record consists of and does not
change as I move through the records in the subform. I
have used this method on the main form without problems.
Any Ideas?
Here is the selection code I have for the combo box.
"SELECT [tblCommLines].[LineNumber] FROM [tblCommLines]
WHERE ( ([tblCommLines].[CampusID]=[Forms]![frmLocations]!
[cboCampusID]) AND ([tblCommLines].[DFID]=[Forms]!
[frmLocations]![subControl].Form![cboDFName]) AND
([tblCommLines].[Type]=[Forms]![frmLocations]!
[subControl].Form![cboType]) ) ORDER BY [tblCommLines].
[LineNumber];"
TIA
AJW
 
E

Eric Butts [MSFT]

Hi,

Are you receiving an error? or is it not working?

Are you needing to refer to different column in the combo box?

Have you used the Eval function the combo box's recordsource, example:

[tblCommLines].[DFID]=Eval("[Forms]![frmLocations]![subControl].Form![cboDFN
ame]")

Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights

--------------------
| Content-Class: urn:content-classes:message
| From: "ajw" <[email protected]>
| Sender: "ajw" <[email protected]>
| Subject: Subform combo box selection
| Date: Fri, 19 Mar 2004 07:43:28 -0800
| Lines: 19
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcQNyOx4RxBydG/RRFC5tSFrYteLpA==
| Newsgroups: microsoft.public.access.formscoding
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.formscoding:225321
| NNTP-Posting-Host: tk2msftngxa13.phx.gbl 10.40.1.165
| X-Tomcat-NG: microsoft.public.access.formscoding
|
| I have a subform that has several combo boxes on it. The
| main form is frmLocations, the sub form is in control
| subControl named subfrmCommLines. I want to have one of
| the combo boxes datasource to be controlled by two of the
| other combo boxes on the subform. The combo box is filled
| with whatever the first record consists of and does not
| change as I move through the records in the subform. I
| have used this method on the main form without problems.
| Any Ideas?
| Here is the selection code I have for the combo box.
| "SELECT [tblCommLines].[LineNumber] FROM [tblCommLines]
| WHERE ( ([tblCommLines].[CampusID]=[Forms]![frmLocations]!
| [cboCampusID]) AND ([tblCommLines].[DFID]=[Forms]!
| [frmLocations]![subControl].Form![cboDFName]) AND
| ([tblCommLines].[Type]=[Forms]![frmLocations]!
| [subControl].Form![cboType]) ) ORDER BY [tblCommLines].
| [LineNumber];"
| TIA
| AJW
|
 

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