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

Inputting text into memo box

Status
Not open for further replies.

upplepop

IS-IT--Management
Jun 1, 2002
173
US
I have an 'Alerts' memo box which I want to display if there is a field the user forgot to fill out (or needs to find the information). For instance, I want a message like "Please find client's zip code" if the zip code field is blank. It should also allow for multiple alerts. Like:

ALERTS
"please find client's zip code"
"Please find client's date of birth"


any ideas?
 
I'm not sure I follow you, but if what you're trying to do is log error messages to be displayed later (rather than when they occur) then do something like this each time an error occurs:

memAlerts = memAlerts & "new error" & vbCrLf
 
Well, look at what I have so far:

Private Sub Form_Load()
If txtZip Is Null Then txtAlerts = txtAlerts & "Zip Code Required" & vbCrLf
End Sub


but nothing is happening when the form loads and there is nothing in txtZip.
What am I doing wrong?
 
Try this :
Private Sub Form_Load()
if txtzip is null or txtzip="" then
txtalerts = txtalerts & "Zip code required" & vbcrlf
end if
end sub

Hth
Borg
 
I tried borg2002's suggestion above, but I'm getting an "Object Required" error and I can't figure out why. In debug, it highlights the -- if txtzip is null or txtzip="" then -- line but it knows that txtzip is null. What's going wrong?
Also, what does vbCrLf do?
 
vbcrlf adds a blank line to your message. So each new errormessage is displayed on a new line.
If isnull(txtzip) or txtzip="" then
txtalerts = txtalerts & "Zip code required" & vbcrlf
end if

This should do it...

Kind regards
Borg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top