Solved Combo box asking for parameters

tmyers

Well-known member
Local time
Today, 15:11
Joined
Sep 8, 2020
Messages
1,090
I have a combo that is giving me problems and I cant seem to figure out the problem.
It is an unbound combo with a query as its row source:
1664463688670.png

When I set the criteria for ProductID to pull the ProductID from the form, it pops up the parameter window when the ID is shown in a text box and available for it to see from what I can tell.
1664463778330.png

1664463821293.png

Why is it not getting the ID from the form and asking for it instead? I havent not had this happen before without an obvious cause.
 
What is the NAME of the control that has ProductID as it's source?
 
Are you sure that the field is bound to a control on the form? Check the Name field of the control you think holds ProductID.
 
The field is both bound to and named ProductID but I changed it to ProductIDTxt as I hate when the wizard names things like that. Even with the change, the parameter window still pops up.
1664468915801.png
 
To try and provide a little clarification, this combo is supposed to show available product based on the ProductID the line on the continuous form has so it can be selected and then deductions run when a label is created.

Attached is what I am working on. You can get to the form in question by opening the report rptWireRoom and clicking the ticket for the first entry. the subform frmWireMulti has the combo in question that is not agreeing with me. Once I figure this out, the other subforms will have a combo just like it as well to select product that is available.
 

Attachments

Well if it is a subform, thati is a completely different matter, as your syntax is using a mainform control?
However if I open that report, the click on 1111, the form opens fine with 18 in the Product ID?

1664470787847.png
 
Last edited:
Actually, now that you mention that Gas I think I have run into this problem before with trying to reference a control on a subform but for the lift of me dont remember how to do it. Will do some research real quick.
 
Bingo! Thanks for point me in the right direction Gas! :giggle:
 
OK, I see the issue, result at least.
However the combo source is fine, just refers to yet another query, so that will be where the incorrect reference is.
 
I was getting the prompt when I tried to make a selection in the combo next to the ID. What I am trying to do is let the person processing this select a reel/coil that has enough footage and cut from that then once they print the label, I will have a query run that deducts the length from the selected item.

Making the adjustment to referring to the subform then the control made it work how I was trying to get it to. The combo should be set to remember the value so I can use it for other things later.
 
Well I changed the ProductID control to txtProductID. I myself prefer the txt as a prefix, easier to identify, for me at least. I also renamed the subformcontrol name, to identify it from the form name.
I then changed the criteria as per the link I gave you.

That now runs, but does not produce anything in the query, but one entry on the subform.

You can take it from there.

Code:
SELECT tblWireRoom.ProductID, tblWireRoom.CurrentLength, tblWireRoom.Hanging
FROM tblWireRoom
WHERE (((tblWireRoom.ProductID)=[Forms]![frmWireRoom]![ctrlfrmWireMulti].[Form]![txtProductID]));

1664471905350.png
 
Gas, I have run into this same problem again but this time its a subform within a subform, so 3 layers down. I am not getting an error, but it is not showing anything either.
Currently my criteria for ProductID on this one is:
[Forms]![frmWireRoom]![frmWireColors].[Form]![tblCutColorWire Subform].[Form]![ProductIDTxt]

When I enter that last .form, I dont get any autofill options for it and when I manually type [ProductIDTxt] it lets me but the results are nothing is returned.
 
Look at that link and get to understand it.
It is a heirarchy. Once you understand that, then take it one level at a time.

Remember subformcontrol name NOT subform name. That is why I renamed the subform in the one I downloaded.
 
I prefer not to hard code criteria using forms.
I would set a TempVar from wherever and use that as criteria.

As you are having so many problems trying to reference correctly, perhaps you should try that option?
 
Actually I discovered that it IS working but is only getting the ProductID for the first line on the continuous form. I am going to have to read up on this more.
 
Actually I discovered that it IS working but is only getting the ProductID for the first line on the continuous form. I am going to have to read up on this more.
You are only specifying one ProductID?
 
The tables are a hierarchy. If you want to see all the rows at the third level, you would use the PK from the second level which is the FK in the third level.
 

Users who are viewing this thread

Back
Top Bottom