PDA

View Full Version : CmdClear on click on my form raises an issue in my code



wedd
12-19-2011, 06:20 AM
Hi vba experts, I've written the following code on a command button; however, it highlights in yellow a field name in my code. What does this indicate? Thanks for your contributions. :friends: I'm a novice/intermediate programmer in visual basic for access.


Private Sub cmdClear_Click()

Title = Null
Location = Null (highlights in yellow)
FirstName = Null
Venue = Null
StartingScheduleDate = Null
EndingScheduleDate = Null
Surname = Null
End Sub

orange
12-19-2011, 07:23 AM
Nothing is equal to NULL.
I would set these fields to zero length string

eg
FirstName = ""
Venue = ""
StartingScheduleDate = ""

wedd
12-19-2011, 07:47 AM
Ok. Thanks!