Dealing with null values in textboxes

Voltron

Defender of the universe
Local time
, 20:08
Joined
Jul 9, 2009
Messages
77
This code is for anyone who is new to VBA and/or Access and is not sure how to deal with null values in their textboxes. This code changes the null values of the First Name and Last Name textboxes to empty strings. If you don't want an empty string then you need to do some KeyPress event procedure coding.

Dim s_First As String
Dim s_Last As String

s_First = Nz([txt_First_Name], "")
s_Last = Nz([txt_Last_Name], "")

txt_First_Name = s_First
txt_Last_Name = s_Last
 

Users who are viewing this thread

Back
Top Bottom