subform cbo

niccig

Registered User.
Local time
Yesterday, 17:16
Joined
Sep 8, 2004
Messages
29
Ok, I posted this last night, and it still won't work. Does anyone have any ideas??? Please help.

I have 2 cascading combo boxes that work on a form [frmSubhourstest]: cboFaculty and cboProject. They work fine with this code as the row source for cboProject:

SELECT tbProject.ProjectID, tbProject.ProjectName, tbProject.CurrentProject FROM tbProject WHERE (((tbProject.CurrentProject)=Yes) And ((tbProject.FacultyID)=Forms!frmSubhourstest!cboFaculty)) ORDER BY tbProject.ProjectName;

I now want this form to be a subform on frmPayDetails. cboProject now won't work, I get an error asking for the parameter value for Forms!frmSubhourstest!cboFaculty

I know it's now on a subform so I've tried to change the syntax:
tbProject.FacultyID=Me.cboFaculty
tbProject.FacultyID=Forms.frmPayDetails!frmSubhourstest.From!cboFaculty

and any number of combinations. It still can't find cboFaculty.
Any suggestions? Wayne, if you're out there, thanks for your help last night, I've tried various options of the FAQ you send me, but still no luck.
 
Open the form in design view and use the CodeBuilder of the combo box underlying query to get the correct syntax
 
Rich, I'm not sure what you mean...sorry very late here in LA and I'm pulling my hair out with this...how do I select the correct syntax????
 
I think I've got it

Rich,
I went into the Query window, right clicked on the criteria that was causing all the problems and in the expression builder I navigated to the form, sub form and then the combo box...the syntax is:

[Forms]![frmPayDetails]![Hours Breakdown test].[Form]![cboFaculty]

[Hours Breakdown test] is the name I gave to the sub form when I put it on the main form. This isn't the same name as the form the sub form is based off. Now it makes sense!

It seems to work.
I thank you!!!! You have saved me much frustration!!!
 

Users who are viewing this thread

Back
Top Bottom