Enter Parameter Value!!!

J

jlute

I'm going nuts with this one. I'm trying to requery a combobox and
populate it according to another combobox.

The combobox I'm trying to populate:
LineID
SELECT tblFacilitiesLineIDs.LineID, tblFacilitiesLineIDs.Description
FROM tblFacilitiesLineIDs
WHERE (((tblFacilitiesLineIDs.txtFacilityID)=[Forms]!
[frmFinishedGoods].[sfrmFGProcessing].[sfrmFGsThermoformParameters]!
[txtFacilityID]));

The combobox that requeries LineID is txtFacilityID:
SELECT tblFacilities.txtFacilityID, tblFacilities.FacilityName
FROM tblFacilities
ORDER BY tblFacilities.txtFacilityID;

Its After Update Event is:
Private Sub txtFacilityID_AfterUpdate()

Me.LineID.Requery

End Sub

So what happens is that I make a selection in txtFacilityID and then
when I click on LineID I get the dreaded: Enter Parameter Value with
"Forms!frmFinishedGoods.sfrmFGProcessing.sfrmFGsThermoformParameters!
txtFacilityID in the dialogue box. I have NO spelling errors. What's
even more puzzling is if I open sfrmFGProcessing outside of
frmFinishedGoods and remove that from the WHERE clause then it works
fine! Why is it when frmFinishedGoods is in the clause (and opened)
does it not work? I thought maybe it was because sfrmFGProcessing was
in a tab control so I took it out and placed it directly in the detail
section of frmFinishedGoods but still no good.

Is it simply because there's too many forms mentioned in the code...?

Thanks for your help!!!
 
D

Douglas J. Steele

The proper syntax is

[Forms]![NameOfParentForm].[NameOfSubformControlOnParentForm].Form![NameOfSubformControlOnFirstSubform].Form![NameOfControl]

Depending on how you added the forms as subforms, note that the name of the
subform control may be different than the name of the form being used as a
subform. That having been said, try

[Forms]![frmFinishedGoods]![sfrmFGProcessing].Form![sfrmFGsThermoformParameters].Form![txtFacilityID]

See http://www.mvps.org/access/forms/frm0031.htm at "The Access Web" for
more details.
 
J

jlute

AHHHHH!!! Thanks, Doug! I just could NOT see that! For as much
experience as I have now I should be catching things like that!

Maybe I'm relying too much on this forum and need to "leave the
nest" ...?

Anyway, thanks for setting me straight!
 

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