help please-- VB, forms, and checking for records existence (1 Viewer)

telepathetic

New member
Local time
Today, 09:22
Joined
Apr 23, 2001
Messages
8
I have an Assets Table and I have a Business Assets Table. They are linked by an Asset ID, and the Business Assets table has a 0,1 to 1 relationship with the Assets table. I have created a form in which a person enters info for the Asset, and then if he decides it's a business asset, he enters in the extra info associated with that table. There is a checkbox that acts as a gatekeeper and locks/unlocks all the business asset fields depending if it's unchecked/checked. Initially however when the record is loaded (On Current event), I need to set the checkbox accordingly. If there is a business asset record for the current asset i want it checked, else not checked. I've tried to do this by checking one of the fields of the Business Assets and seeing if it's Null. This does not work for some reason i do not understand. Please advice me at any level.

here is my code from the On Current event: ([Date] is a field in Business Assets)

If ([Date].Value = Null) Then
[BusinessCheck].Value = False
Else
[BusinessCheck].Value = True
End If

that code will always make the checkbox checked (true). even when my watch says the value is Null the program steps to the second statement
i've also tried "If ([Date] Is Null) Then" this gives a compile error.

help me please
 
R

Rich

Guest
If IsNull(Me.Date) Then
Me.BusinessCheck = False
Else
Me.BusinessCheck = True
You should change your field name Date to something else since Date is a reserved word in access and you will get problems.
 

Users who are viewing this thread

Top Bottom