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

Conditional Code on Combo

Status
Not open for further replies.

avagodro

Technical User
Aug 12, 2005
83
US
I have a combo box in a subform that was displaying data from previous selections. I was able to correct that with Me.ComboName=" "

However, I am drawing a blank on having it conditional. If there is saved information in the table, it would display it, otherwise it would run the Me.ComboName=" "
I had thought of using
Code:
DLookup ("Rspns", "tblResponses", "QstnID=" & Me!QstnID)
to check the table, but as I said I am drawing a blank on the IF..Then..Else statement.
 
Not sure what's going on here but the conditional statement in the DLookup function needs to have quotation marks around the whole statement. Also use the full form reference instead of the Me keyword. So the statement should read something like:

"QstnID = criterion"

Hope this helps
 
how are ya avagodro . . .

Try this:
Code:
[blue]= IIF IsNull(DLookup ("Rspns", "tblResponses", "QstnID=" & Me!QstnID)), " ", DLookup ("Rspns", "tblResponses", "QstnID=" & Me!QstnID)[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top