Hello,
I would really appreciate some help with coding problem. As you can see I am not very well up on it!
I have a combo box on a form returning three values - Engineer, Medical, Both.
I also have three matching macros which will print a particular letter (form) for the relevant client record - M:letter_PALS_eng, M:letter_PALS_med, M:letter_PALS_both.
What I want to be able to do is for the result of the combo box to trigger the relevant macro, which will print the required letter out.
-------
Private Sub PALS_letter_combo_AfterUpdate()
iif(Forms![F:fault]![PALS letter combo].Column(1)="Engineer", DoCmd.runMacro "M:letter_PALS_eng",,"
iif(Forms![F:fault]![PALS letter combo].Column(1)="Medical", DoCmd.runMacro "M:letter_PALS_med",,"
iif(Forms![F:fault]![PALS letter combo].Column(1)="Both", DoCmd.runMacro "M:letter_PALS_both",,"
End Sub
-------
This is the code I have put in the after event on the combo box and, no surprise, it doesn't work. I keep getting compile errors saying 'expected'.
I would be very grateful if someone could point me in the right direction. (Also bearing in mind that my knowing of code is somewhat sketchy!)
Many thanks.
I would really appreciate some help with coding problem. As you can see I am not very well up on it!
I have a combo box on a form returning three values - Engineer, Medical, Both.
I also have three matching macros which will print a particular letter (form) for the relevant client record - M:letter_PALS_eng, M:letter_PALS_med, M:letter_PALS_both.
What I want to be able to do is for the result of the combo box to trigger the relevant macro, which will print the required letter out.
-------
Private Sub PALS_letter_combo_AfterUpdate()
iif(Forms![F:fault]![PALS letter combo].Column(1)="Engineer", DoCmd.runMacro "M:letter_PALS_eng",,"
iif(Forms![F:fault]![PALS letter combo].Column(1)="Medical", DoCmd.runMacro "M:letter_PALS_med",,"
iif(Forms![F:fault]![PALS letter combo].Column(1)="Both", DoCmd.runMacro "M:letter_PALS_both",,"
End Sub
-------
This is the code I have put in the after event on the combo box and, no surprise, it doesn't work. I keep getting compile errors saying 'expected'.
I would be very grateful if someone could point me in the right direction. (Also bearing in mind that my knowing of code is somewhat sketchy!)
Many thanks.