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

VB Code to Check and Update Field

Status
Not open for further replies.

penndro

Technical User
Jan 9, 2005
108
US
I have created an Access 2000 form that has yes/no checkbox fields on it. I have corresponding dates that should be updated when the item is checked off. I am new to VB and cannot get my code to work. Can someone give me some tips.

Here is what my code looks like:

Private Sub Reg_Form_Check_AfterUpdate()
If RegFormInDate = Null And RegFormCheck = True Then
RegFormInDate.Value = Now()
End If
End Sub
 
Nothing equals Null (not even Null). Try change your code to:
Code:
Private Sub Reg_Form_Check_AfterUpdate()
   If IsNull(Me.RegFormInDate) And Me.RegFormCheck = True Then
       Me.RegFormInDate.Value = Now()
    End If
End Sub

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top