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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a value from a control property in a Subquery

Status
Not open for further replies.

thefarg

Programmer
Jan 25, 2012
94
NZ
I have a combobox. It has "A" as the value in the .Tag property.
As the rowsource I have a list of values in a table. I want to set the controlsource to a single record in a table, simular to
dlookup ("Column", "Table", "Row =" & Variable).
I am trying to set the controlsource to
[SELECT tblIdentifiers.[Identifier Name] FROM tblIdentifiers WHERE (tblIdentifiers.[Identifier Letter] = Me.Activecontrol.Tag)]
but am unsure about using a variable or property in an SQL statement.
Any help much appreciated
Mike
 

Have you tried:
[tt]
strSQL = "SELECT tblIdentifiers.[Identifier Name] FROM tblIdentifiers WHERE (tblIdentifiers.[Identifier Letter] = '" & Me.Activecontrol.Tag & "')"
[/tt]


Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top