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

Can vbNullString be used in VBA as well as VB4-6? 1

Status
Not open for further replies.

kjv1611

New member
Jul 9, 2003
10,758
US
I came accross an old thread, thread222-259902 , as a suggested reading on the topic of using null values. My question is can [blue]vbNullString]/blue] be used in VBA for Microsoft Applications (specifically Access), or no?

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Yes. I just tested it with Access 2003.

Public Function vbNullStringTest()
Dim s As String

If s = vbNullString Then
s = "It works"
Else
s = "It fails"
End If
Debug.Print s
End Function

Immediate Window:
?vbNullStringTest()
It works
 
Thanks for the input!

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top