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

Checking when second time

Status
Not open for further replies.

AndreB

Programmer
Aug 21, 2001
13
US
I have a form that saves the value of a ComboBox on a table... So far so good....
My problem is: I need to add a number 1(or a checkmark) beside the saved value(on another column ) if the same value of a ComboBox is selected twice. I don't know how to compare the lines of a table with the value selected in a ComboBox...

 
if the field is a number...
Dcount("Fieldname","TableName","Fieldname = " & Forms!formname!CombBoxName)

If it is text...

Dcount("Fieldname","TableName","Fieldname = """ & Forms!formname!CombBoxName) & """"

If you use that in the control source of your box you'll get a count of the field. You might also look at the iif function for additional tests. If you set a control source to something other to a field name as you probably will, put an "=" (equal sign) before the function or whatever you're using.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top