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

Invalid use of null 1

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
I have the below code on my form. When I go to add a new record I get a Runtime Error (94) invalid use of null.
I am hoping this is something simple. Can anyone tell me
why this is happening?

Code:
Private Sub Form_Current()
   
Me.RoutingFinance1.Enabled = (Me.FinanceCheckList1_1 And Me.FinanceCheckList1_2)
     
Me.RoutingBom1.Enabled = (Me.BomCheckList1_1 And Me.BomCheckList1_2 And Me.BomCheckList1_3 And _
Me.BomCheckList1_4)
     
Me.RoutingEngineering1.Enabled = (Me.EngineeringCheckList1_1)

Me.RoutingPurchasing1.Enabled = (Me.PurchasingCheckList1_1)

Me.RoutingFinance2.Enabled = (Me.FinanceCheckList2_1)
    
Me.RoutingBom3.Enabled = (Me.RoutingFinance1 And Me.RoutingBom1 And Me.RoutingEngineering1 And _
Me.RoutingPurchasing1 And Me.RoutingFinance2)

End Sub

Private Sub FinanceCheckList1_1_AfterUpdate()

Me.RoutingFinance1.Enabled = (Me.FinanceCheckList1_1 And Me.FinanceCheckList1_2)

End Sub
 
I would say that you need a vlue if null for all the checks, for example:

[tt]Me.RoutingFinance1.Enabled = Nz((Me.FinanceCheckList1_1 And Me.FinanceCheckList1_2),False)
<...>[/tt]

Or else do not check with a new record:

[tt]If Not Me.Newrecord
Me.RoutingFinance1.Enabled = (Me.FinanceCheckList1_1 And Me.FinanceCheckList1_2)
<...>[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top