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!

An if statement and a combo box... 1

Status
Not open for further replies.

SeadnaS

Programmer
May 30, 2011
214
OK, i have a combo box which lists some numbers. The numbers come from a table called specs i'm using a SELECT DISTINCT for the combo box so it doesn't show duplicate numbers.

I have an if statement that checks to see if the number selected in the combo box matches a number selected in another combo box and displays a "!" in a text box if it doesn't match.

My problem is that when i select the matching number again the "!" doesn't go away. Does anyone know what i might be doing wrong. Here's the VBA code:

If Me.MODEL_NO.Column(6) = Me.QRBP_PRESSURE.Value Then

Me.qrbp_test.Value = ""
Else: Me.qrbp_test.Value = "!"

End If
 
Here's the VBA code
And where is this code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Its in the On Update event of the combo box.
 
On Update event of the combo box
Really ???

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You shouldn't need code since the calculated value shouldn't typically be saved. Try set the control source of the text box to:
Code:
 =IIf(Model_NO.Column(6) = QRBP_PRESSURE.Value,"" ,"!")

Duane
Hook'D on Access
MS Access MVP
 
Yes i figured that one out myself!

Thanks for the help dh!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top