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 SkipVought 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
0
0
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
 
In the AfterUpdate event of your text box, place this code:

If Me!Textboxname = 0 or IsNull(Me!Textbox) then
Msgbox &quot;Enter a value greater than zero dummy!&quot;
Me!Textbox.Setfocus
Me!Textbox.bordercolor = 255
else
Me!Textbox.bordercolor = 0
end if

:)

Uncle Jack
 
Thanks Unc that did the trick. Another quick question for you if you don't mind: Are there any good books that you've seen on VBA for Access?

Russ
 
I used Beginning Access 97 VBA Programming to get me started a few months ago. The authors are Robert Smith and David Sussman.
 
Thanks,

2 questions:
Have you seen one for 2000?
Does the one for 97 get advanced?

Russ
 
I just checked Amazon.com. They have one for Access 2000. They also have a title, Professional Access 2000 Programming, that appears to be an intermediate level book. I used the Beginning book quite a bit at first, and would recommend it as a good place to start.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top