I have a combo box with three choices and a field that is set to read the date. I would like to have the date clear when one of the choices is selected. Any thoughts?
Ooops...I forgot, place that code in the "event" propertie of the "combo object" that you would like to trigger the executituon of the code
I'm not for certain if I completely understand. My combo box, "CustomerType" has 4 choices; Existing, Potential, Lost, Unable To Help. The second field is the "CustomerPurchaseDate". The Customer in my system could possibly be, "Existing" with a purchase date of "01/01/2003". I would like the date to be removed if the "CustomerType" of Lost is selected. I understand event procedures, but I'm not for certain which event. Could you explain a little further?
That worked great! Now another...Now I have two check boxes. They read: "Quote Won" "Quote Lost". There are a few fields that go along with them. They are: "Percentage Chance To Gain Sale" "Proposed Win Date" "Proposed Won Amount" & "Annual Support Generated". I would like to be able to Check the box, "Quote Won" and have the "Percentage Chance To Gain Sale to read 100% and the "Proposed Win Date" to change to the current date. If the "Quote Lost" box is checked, I would like the "Percentage Chance To Gain Sale" to read 0%, the "Proposed Date To Gain Sale" to erase, and the "Proposed Won Amount" and the "Annual Support Generated" fields to go to $0.00. HELP!
Private Sub QuoteWon_AfterUpdate()
If Me!QuoteWon = True Then
Me!QuoteLost = False
Me!PercentageChanceToGainSale = 1 'if control not formatted as % use 100 Me!ProposedWinDate = Date
Else
Me!QuoteLost = True
Me!PercentageChanceToGainSale = 0
Me!ProposedWinDate = Null
Me!ProposedWonAmount = 0
Me!AnnualSupportGenerated = 0
End If
End Sub
Private Sub QuoteLost_AfterUpdate()
If Me!QuoteLost = True Then
Me!QuoteWon = False
Me!PercentageChanceToGainSale = 0
Me!ProposedWinDate = Null
Me!ProposedWonAmount = 0
Me!AnnualSupportGenerated = 0
Else
Me!QuoteWon = True
Me!PercentageChanceToGainSale = 1 'if control not formatted as % use 100 Me!ProposedWinDate = Date
End If
End Sub
Notice, I have taken the spaces out of the control names, I think you should do the same. It makes it easier to reference them.
Thanks so much! I do have my control names without spaces. I failed to report that to you...sorry. One more thing....How would I alter the above thread. The one pertaining to the "LostCustomer" to give me a message box that says: "Changing The Customer Type To "Lost" Will Remove The Purchase Date. Continue?" If yes, is checked, then proceed with the above thread and if not...leave as is.
This should work ok for you.
Private Sub QuoteWon_AfterUpdate()
Dim Response
If Me!QuoteWon = True Then
Me!QuoteLost = False
Me!PercentageChanceToGainSale = 1 'if control not formatted as % use 100
Me!ProposedWinDate = date
Else
Response = MsgBox("Changing The Customer Type To 'Lost' Will Remove The Purchase Date. Continue?", vbYesNo, "Quote Lost"
If Response = vbNo Then
Me!QuoteWon = True
Exit Sub
End If
Me!QuoteLost = True
Me!PercentageChanceToGainSale = 0
Me!ProposedWinDate = Null
Me!ProposedWonAmount = 0
Me!AnnualSupportGenerated = 0
End If
End Sub
Private Sub QuoteLost_AfterUpdate()
Dim Response
If Me!QuoteLost = True Then
Response = MsgBox("Changing The Customer Type To 'Lost' Will Remove The Purchase Date. Continue?", vbYesNo, "Quote Lost"
If Response = vbNo Then
Me!QuoteLost = False
Exit Sub
End If
Me!QuoteWon = False
Me!PercentageChanceToGainSale = 0
Me!ProposedWinDate = Null
Me!ProposedWonAmount = 0
Me!AnnualSupportGenerated = 0
Else
Me!QuoteWon = True
Me!PercentageChanceToGainSale = 1 'if control not formatted as % use 100
Me!ProposedWinDate = date
End If
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.