Checkbox Default Value Based on Another Field

sparklegrrl

Registered User.
Local time
Today, 14:52
Joined
Jul 10, 2003
Messages
124
Is there any way to set a checkbox on a form so that if for example there is a car number in the car number field the default value is true?
 
sparkle,

Depending on how you want to use it, you can use the BeforeUpdate
event of the CarNumber field to:

Code:
If Not IsNull(Me.CarNumber) Then
   Me.CheckBox = True
Else
   me.CheckBox = False
End If

You could put it in the BeforeUpdate of the form if you wanted
to "synch" existing records.

You can put it in the OnCurrent event of the form if you wanted
to "synch" records that the user visited.

Or you can do an Update query to fix them all.

Wayne
 
Thanks but it doesn't seem to be working.

The user will open this form, enter one small number and then hit print.

It is based on a query which the form is pulle up by job number. The form has the customer, job number, car number, other number, date, purchase order number, etc.

I need it to put a checkmark next to car number, trailer number or other based on whether or not those fields are populated and I want it to auto do it when the form is opened.

That code isn't working for me...am I doing something wrong?m I need it to basically be the default value based on wheter or not the field (car number, trailer, etc) is populated. (I have 3 of these checkboxes).
 
Last edited:
Don't ask me, just a form we have to have due to Federal Regulations and the American Association of Railroads guidelines.

Doesn't seem to me they are really even needed if the car number, etc. is listed...ya know.
 
=IIf([MyField],True,False) as the control source for the check box where MyField contains the value
 

Users who are viewing this thread

Back
Top Bottom