rookie here, so bare with me - 2?

lab18

New member
Local time
Today, 16:25
Joined
Feb 19, 2002
Messages
8
probably very simple:
1.- I have a form to enter orders, what i want is that, when i enter the customer name (first and last name - 2 separate fields) if the customer is not on record a msg box pops up letting me know it and asking me if i want to add it. Then if i click yes, the "enter new customer form" opens, but i select no, it wont let me add it and ill have to enter a diff name.
2.- i have several fields that require a + or - sign be in front of the number, i want that if i forget to enter either i get an error. and if possible, the format for the number after the sign should be xx.xx
for example if i enter 1299 i get 12.99 if i enter 299 i get 2.99 but if i enter 99 i want 0.99

thanks
 
I don't have time to look into the first and last part of your post, but I was able to figure out the +/- thing pretty quickly. Use the following code in the On_Exit event of each field requiring the +/-:

Code:
Private Sub Field1_Exit(Cancel As Integer)
If Not left(Field1, 1) = "+" And Not left(Field1, 1) = "-" Then
MsgBox "This field must begin with a + or - sign."
Cancel = True
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom