If 2 conditions are met, then change field, if one of those is not met, Then leave.

cookitup

Registered User.
Local time
Today, 15:09
Joined
Apr 4, 2012
Messages
33
I am trying to make sure 2 conditions are met before changing the field. If one of those conditions is NOT met, Then I want the fields to be left alone.
Here is my beginner, Feable attempt at doing this:

Private Sub Quote_Amount_AfterUpdate()
If Me.Quote_Amount.Value > 0 & Me.Job_Number.Value = 0 Then
Me.Date_Bid_Sent = Now()
Me.Status.Value = "Have Pricing"
Else
Me.Date_Bid_Sent = 0
End If
End Sub

What I amtrying to do is,if the quote amount is added after the Job number has been added. I want the fields to remain as they are. If no job number is given, (Me.Job_Number.Value = 0) then I want the fields to change per the syntax above.
I know there is plenty missing here, Could someone help me with this!!
 
& is a concatenation operator. You want And there.
 
Same as pbaldy

Code:
If Me.Quote_Amount.Value > 0 AND Me.Job_Number.Value = 0 Then

Also:
Setting a date to 0 makes the date to something like 12/30/1899 12:00:00 AM.

You probably want to say:
Code:
Me.Date_Bid_Sent = Null
 
Thanks a bunch to both of you, Worked perfectly!!!!
 

Users who are viewing this thread

Back
Top Bottom