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!

Help With Visual Basic

Status
Not open for further replies.

bwedmund

Technical User
Oct 29, 2000
17
US
I have written the Visual Basic Line Below.

Private Sub Percent_Of_Pumps_at__04_or_More_GotFocus()
MsgBox "Please Retest. Pumps Are 80% Or More"

End Sub

What I would like for the line to do is -- if the Percent_of_Pumps_at__o4_or_More is 80% or more it will display the message. If is is less than 80%, I woulk like for it to say "less than 80%.


I would also like for the message box to be bigger than it is if possible.

Thanks

Barry
 
I would have thought you would want to create something like:


Private Sub Pumps ()
If Pumps.Value =>80 Then MsgBox "Please retest..."
ElseIf Pumps.Value <80 Then MsgBox &quot;less than 80%&quot;
End If

This is assuming you have one field which contains the value for pumps (i have shortened it because i am feeling lazy!). If you have a boolean field for pumps>80 then you would need to modify it to something like the following:

Private Sub Pumps ()
If Pumps.Value = True Then MsgBox &quot;Please retest...&quot;
ElseIf Pumps.Value = False Then MsgBox &quot;less than 80&quot;
End If

As for sizing the messagebox, i am not sure if you can do that in access.....

Hope this has helped a little
 
I am not aware of how to size the message box either. You could open a form designed as a custom message box. This would allow you to make the warning as LOUD as you want. Ie. Flashibng Red Lights, Pictures, Skulls and Crossbones whatever.
Dave
gallagherd@earthlink.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top