Hi again, I'm having trouble on another part of the form now.
Recap- User enters a lastname into TextEntry textbox
Checkbox CheckM1 becomes checked if there is a date in TextEntry's field M1
If the user checks an unchecked box, TextEntry's DateField value should change to the current date
If the user unchecks a checked box, TextEntry's DateField value should change to null
The problem is with the last two parts, I'm not getting any update in TextEntry's DateField? Instead, new records with the DateField filled in are created in table.
I'm using the code Bry (BTW Bry, Thanks ;-)) gave out for the text entry box
Private Sub TextEntry_AfterUpdate()
Dim last As String
last = "LastName = '" & TextEntry & "'"
DLookup("CheckField", "TABLE", last)
If IsNull(DLookup("CheckField", "TABLE", last)) Then
Me.CheckM1 = False
Else
Me.CheckM1 = True
End If
End Sub
And this is CheckM1's code
Private Sub CheckM1_AfterUpdate()
If Me.CheckM1 Then
Me!DateField = Date
Else
Me!DateField = Null
End If
End Sub
Recap- User enters a lastname into TextEntry textbox
Checkbox CheckM1 becomes checked if there is a date in TextEntry's field M1
If the user checks an unchecked box, TextEntry's DateField value should change to the current date
If the user unchecks a checked box, TextEntry's DateField value should change to null
The problem is with the last two parts, I'm not getting any update in TextEntry's DateField? Instead, new records with the DateField filled in are created in table.
I'm using the code Bry (BTW Bry, Thanks ;-)) gave out for the text entry box
Private Sub TextEntry_AfterUpdate()
Dim last As String
last = "LastName = '" & TextEntry & "'"
DLookup("CheckField", "TABLE", last)
If IsNull(DLookup("CheckField", "TABLE", last)) Then
Me.CheckM1 = False
Else
Me.CheckM1 = True
End If
End Sub
And this is CheckM1's code
Private Sub CheckM1_AfterUpdate()
If Me.CheckM1 Then
Me!DateField = Date
Else
Me!DateField = Null
End If
End Sub