T
tina
if you run the "open a pop-up window to add an item to the droplist" code
from the combo box control's NotInList event, Access will do the requerying
for you. example:
If MsgBox("Add item to list?", vbDefaultButton1 + vbYesNo) = vbYes Then
DoCmd.OpenForm "FormName", , , , , acDialog
Response = acDataErrAdded
Else
Response = acDataErrContinue
Me!ComboBoxName.Undo
Me!ComboBoxName.Dropdown
End If
substitute the correct name of the pop-up form and the correct name of the
combo box control, of course. opening the form with the acDialog setting
causes the code to pause until the form is closed again, then "Microsoft
Access updates the list by requerying the combo box. Microsoft Access then
rechecks the string against the combo box list, and saves the value in the
NewData argument in the field the combo box is bound to." (from the
NotInList Event topic in VBA Help.)
hth
from the combo box control's NotInList event, Access will do the requerying
for you. example:
If MsgBox("Add item to list?", vbDefaultButton1 + vbYesNo) = vbYes Then
DoCmd.OpenForm "FormName", , , , , acDialog
Response = acDataErrAdded
Else
Response = acDataErrContinue
Me!ComboBoxName.Undo
Me!ComboBoxName.Dropdown
End If
substitute the correct name of the pop-up form and the correct name of the
combo box control, of course. opening the form with the acDialog setting
causes the code to pause until the form is closed again, then "Microsoft
Access updates the list by requerying the combo box. Microsoft Access then
rechecks the string against the combo box list, and saves the value in the
NewData argument in the field the combo box is bound to." (from the
NotInList Event topic in VBA Help.)
hth