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

Listbox - only one item

Status
Not open for further replies.

mpnorris

IS-IT--Management
Dec 31, 2002
66
US
I have a list box on my form which brings back the results of a query. The list box will only show one number. Is there a way to automatically highlight that number so that it does not have to be clicked on?

I am then using that data in another calculation.

The only reason I am doing a list box is because I can't figure another way to bring in the result of the query.

Any help is greatly appreciated.

Thanks.
 

you could assign a variable using DLookup:
quoteloc = DLookup("Location", "Users", "[UserNames] = '" & fWin2KUserName & "'")

or if it's a complicated query you could open a recordset and assign a value like this:

Dim db As Database, rs As Recordset, locked As Variant

Set db = CurrentDb()
Set rs = db.OpenRecordset("qryPartforLocked")
locked = rs("Locked")
 
what's your query (sql) string?
what's the rowsource of the list box?
what's the "other" calculation that you're using this result for?
when is the list box filled? Are you clicking a button or something?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top