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

Case Select - empty string 1

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
ZA
In a Case select I need to reference a test expression = ""
For example:
Case strReportReference = ""

If strReportReference = "", the case function does not run the code immediatley under it, but goes to the next Case ... line


What is the correct syntax to trap "" ?


strReportReference is dimensioned as a string
 
If this is a variable of datatype string, then

[tt]select case strReportReference
case ""
msgbox "zls"
case else
msgbox "dunno"
end select[/tt]

If it is a variant, or a form control, then it might perhaps be Null, which I don't think you'll be able to trap like that. Then in stead for instance

[tt]if trim$(strReportReference & "") = "" then
msgbox "either zls, Null or containing only spaces"
end if[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top