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

If (checkbox) = True, The (textbox) = "Yes"

Status
Not open for further replies.

RobertIngles

Technical User
Jan 20, 2011
113
CA
I want to make sure the user see's who is a VIP user in a datasheet. I am trying to code that if the VIPUser Checkbox is checked (true), that the unbound text box VIPID displays "VIP" and if the checkbox is false, the unbound text box displays null.
Here is the code:

Private Sub Form_Open(Cancel As Integer)
If Me.VIPUser = True Then
Me.VIPID = "VIP"
Else
Me.VIPID = Null
End If

End Sub

The result of the code is that the unbound field displays "VIP" for all records, not just the ones where VIPUser has been checked.

Any help on what I am doing wrong is appreciated!
 
Put your code in the Current event procedure of the form instead of the Open.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PH, unfortunately it is still showing all records as VIP. Any other suggestions?
 
Well, have a look to conditiononal formatting

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top