If statement

astarbyfar

Registered User.
Local time
Today, 15:35
Joined
Apr 27, 2003
Messages
93
I previously produced a tick box in a form with the use of a Yes/No data type. However i wanted to produce code that display a number of objects if the the box is ticked. Hence I produced the following code

Private Sub Partsseperate6_AfterUpdate()
If Partsseperate6 = True Then
display objects
ElseIf
dont display objects
End If
End Sub

That worked fine. Now the company Im working for want a Yes or No value list i.e. in a combo box. When I swap True with Yes it no longer works. Ive tried using quotation marks and even Partsseperate.Value but they are not working. Has anyone any suggestions?
 
Apoligies ignore the ElseIf statement. It should just be Else
 
Since it's a text value now, the If statement should require quotes around "Yes". Since that didn't work, add a debug.print or msgbox and see what the value of the combo actually is. Perhaps you have more than one column and the bound column doesn't contain "Yes" or "No".
 

Users who are viewing this thread

Back
Top Bottom