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

textbox vbmodal?

Status
Not open for further replies.

rry2k

Programmer
Jun 28, 2001
678
US
I have vaildation that I would like to do on a textbox. The code looks like this:
If txtBillableHours <> 0 And txtBillingRate = 0 Then
txtBillingRate.SetFocus
MsgBox &quot;Please enter a billing rate.&quot;
End If

My question is:
Can I make a text box modal or some variantion so they have to enter a value other than 0. And how do I highlight the textbox so it stands out once I set the focus?

Thanks..Russ
 
You really are going to need InputBox() or to make another form which is set to Modal and use a DoCmd.OpenForm. MsgBox only is used to display messages to the user or ask simple questions. To make a normal form modal just toggle the 'Modal' property of the form itself to 'Yes'.

However because you were using MsgBox() above I decided to list how you do a MsgBox() as a modal as well. Also if you check the help files on MsgBox there is a more extensive list of arguments there. These are the two that deal with Modal windows.

Basically though there are two modal settings which are 'vbApplicationModal' and 'vbSystemModal'.

vbApplicationModal - Suspends all other activities
within current Application
until popup is completed.

vbSystemModal - Suspends all applications on
entire system until popup is
completed.

So the syntax to use one of these would be either:

MsgBox &quot;<text to display>&quot;, vbApplicationModal, &quot;<title>&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top