Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate Combo box based on Parameter Query

Status
Not open for further replies.

resslers

Programmer
May 15, 2001
1
US
I have a combo box on my form that I would like to populate based on a field value contained in a textbox on the same form. This textbox is populated when the form is opened.

I have tried to create a parameter based select query for the rowsource, but to no avail. Currently, this is the statement that I'm using.

SELECT [Insurer].[I_Name], [BetaColon].[PTID]
FROM BetaColon INNER JOIN (Insurer INNER JOIN INSURER_DTL ON [Insurer].[ID]=[INSURER_DTL].[Insurer]) ON [BetaColon].[PTID]=[INSURER_DTL].[Id]
WHERE ((([BetaColon].[PTID])= ??needs to be the field value??

If I hard code in a value the combo box works (I'm requerying using a macro each time I enter the combo box).

What is the correct syntax for getting the parameter value into my select statement?

Any help is greatly appreciated.

resslers
 
Your WHERE statemenet should be in the form of:
WHERE ((([BetaColon].[PTID])= [Forms]![frmName]![ControlName]))

This assumes it is not working as a subform...


James Goodman
 
Hi resslers,

Just put the reference to the form field in the critera of your query. Then you can go to view SQL to see the statement. HTH

Best regards,

Henr¥
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top