Load form If certain selection in list box

F

fordrules01

Ok not sure if the logic fits but this is what i'm trying to do.

I have a CRM database built that tracks correspondence of customers. If a
customer calls up and wants a quote I want the call logged against the
customer but I also want the option to raise a quote on the spot. In the
"correspondance_subform" i have a field "List_Regarding" that has a number of
different options. If the person taking the call choses "Hire Quote" from the
list I want a form to load asking if they would like to raise an quote now
(form already created). If they choose anything else from the list I just
want it to populate and move on to the next item in the
"correspondance_subform"

What i would like is some VBA (or simpler method) to check if "Hire Quote"
has been selected and if so raise the form. Otherwise move on. Please note i
have a very limited understanding of VBA.

Cheers,

Matt
 
F

fordrules01

Thanks James. Worked perfectly

James said:
Hi

In forms properties select the "List_Regarding" field and select After
Update event. Then paste the following into the VBA window and change
the form name to what yours is called...

If in the list "Hire Quote" is only the displayed value rather than
the bound column (key value) then you may need to change this in the
first line.

If Me.List_Regarding.Value = "Hire Quote" Then
If MsgBox("Do you want to raise a quote now?", vbYesNo, "Raise
Quote?") = vbYes Then
DoCmd.OpenForm "YourQuoteFormNameHere"
End If
End If

Regards
James
 
Top