Runtime Error '94' Invalid Use of Null - Access 2000

BlueChicken

Usually Confused
Local time
Yesterday, 16:15
Joined
Jun 19, 2009
Messages
88
Hi!

Ok, this was working - and does work in another database I made, however it is no longer working and starting to piss me off! :mad:

I made a form where when a check box is checked, all relating fields will become visible on the form. There are three of these on the form, each making several fields visible. This works perfectly. However, when the new record button is pressed (>*), I get run time error #94. Attached are a few pictures of my error... both visually and the highlighted code in debugging mode (I am thinking it is actually an error with my Form_Current code)

Everything is spelled properly... I made sure of that.

I really have no idea what is going on!

Any help would be... helpful!

Thanks, BlueChicken
 

Attachments

How about posting the OnCurrent event code so we can see it?
 
It was in the pictures attached but here it is anyway:

Code:
Private Sub Form_Current()
    Call AirTravel_Click
    Call Hotel_Click
    Call Rental_Click
End Sub

The three "Clicks" are my three check boxes.
 
To what type of fields are the CheckBoxes bound? What is there default value. The way your code is set up, the default value should probably be 0. If not set, it will be Null and cause the error you see.
 
Look at the fields directly in the table in design view. What are the defaults set to?
 
seems like i am having a VERY similiar problem...

my form works fine to duplicate and move to next record as is when no code is added, but when i added the code to make fields visible/invisible based on a click box, when i click "duplicate record" or "next record" i get "invalid use of null:

though im unsure what you mean by checking what the fields are bound to for a Y/N box? thers no "default value" option that is not code?

here is my code

Private Sub Form_Current()
Me.FS_Type_1.Visible = Me.Stat_Audit_Yes_No
Me.Service_Provider_1.Visible = Me.Stat_Audit_Yes_No
Me.Stat_Date_1.Visible = Me.Stat_Audit_Yes_No
Me.FS_Type_2.Visible = Me.Stat_Audit_Yes_No
Me.Service_Provider_2.Visible = Me.Stat_Audit_Yes_No
Me.Stat_Date_2.Visible = Me.Stat_Audit_Yes_No
Me.FS_Type_3.Visible = Me.Stat_Audit_Yes_No
Me.Service_Provider_3.Visible = Me.Stat_Audit_Yes_No
Me.Stat_Date_3.Visible = Me.Stat_Audit_Yes_No
End Sub
Private Sub Stat_Audit_Yes_No_AfterUpdate()
Me.FS_Type_1.Visible = Me.Stat_Audit_Yes_No
Me.Service_Provider_1.Visible = Me.Stat_Audit_Yes_No
Me.Stat_Date_1.Visible = Me.Stat_Audit_Yes_No
Me.FS_Type_2.Visible = Me.Stat_Audit_Yes_No
Me.Service_Provider_2.Visible = Me.Stat_Audit_Yes_No
Me.Stat_Date_2.Visible = Me.Stat_Audit_Yes_No
Me.FS_Type_3.Visible = Me.Stat_Audit_Yes_No
Me.Service_Provider_3.Visible = Me.Stat_Audit_Yes_No
Me.Stat_Date_3.Visible = Me.Stat_Audit_Yes_No
End Sub

Thanks
 

Users who are viewing this thread

Back
Top Bottom