Combo Box / Code problems

Ally

Registered User.
Local time
Today, 03:33
Joined
Sep 18, 2001
Messages
617
I have a form with a subform. The subform has 3 fields which are a dropdown list of dates relating to courses, and 2 checkboxes re attendance and cancellation.

It is unlikely that the staff member will be put on a second course, but not impossible which is why I made it a subform.

I put a count box in the subform footer and some code, originally on GotFocus, then BeforeUpdate of the combo box to count the number in the count box and if more than one to display a message box re "Are you sure you wish to add another course date?", vbYesNo.

The "Yes" is working fine, but with the "No", it did the same thing as the "Yes" with the dropdown box remaining "dropped down". I've tried DoCmd.CancelEvent, Cancel = True, Exit Sub including a combination of them.

Then I tried moving the focus to another field and back to the combo, but got an error message about it having to be saved before it could do that. So added DoCmd.RunCommand acCmdSaveRecord and now I get a message,

"Run-time error 2046. The command or action isn't available now."

Anyone got any ideas please?
 
Last edited:
Yeah - cool! Thanks! :p
 

Users who are viewing this thread

Back
Top Bottom