K
Kurt
My forms have several combo boxes which are populated with values from one
table, tblLookup, using a where clause to filter for values relevant for that
particular combo box. For example:
tblLookup
Label Filter
-------------------
Male SEX
Female SEX
John STAFF
Mary STAFF
Bob STAFF
…
This way I keep all my look up values in one table for ease of management.
If the user comes across a combo box on the form which doesn’t have a needed
value (e.g., they need to add a new staff member to the list), they can click
on a custom menu button which opens frmLookup. frmLookup is a continuous form
that shows all the labels and filters in tblLookup. On this form, they simply
add a new record and enter the appropriate label (e.g., “Kevinâ€) and the
appropriate filter (e.g., “STAFFâ€). Then they close the form and return to
the main form.
The Form_Load code for frmLookup sets the visible property of the main form
to False, and the Form_Close code sets it back to visible.
The way it’s set up now, when the user returns to the main form, the combo
box isn’t refreshed with the updated list of values. He has to close the form
and then reopen it in order to see the updated list.
Because I have so many combo boxes, I would rather not code each one, or put
a button next to each one. Also, because I’d like the user to return to the
screen with the focus set to the control he was working on, I’d rather not
set the code to close the main form entirely and then reopen it.
Is there a way to refresh every possible combo box when the user closes
frmLookup? Or is it a better idea to: When they open frmLookup, save the
record they were working and close the main form, and when they close
frmLookup, reopen the main form (to the same screen/subform/control they
might have been on).
Thanks. (Code for frmLookup below.)
Kurt
Private Sub Form_Load()
Form_frmPatients.Visible = False
End Sub
Private Sub lblClose_Click()
DoCmd.Close , , acSaveYes
End Sub
Private Sub Form_Close()
Form_frmPatients.Visible = True
DoCmd.Maximize
End Sub
table, tblLookup, using a where clause to filter for values relevant for that
particular combo box. For example:
tblLookup
Label Filter
-------------------
Male SEX
Female SEX
John STAFF
Mary STAFF
Bob STAFF
…
This way I keep all my look up values in one table for ease of management.
If the user comes across a combo box on the form which doesn’t have a needed
value (e.g., they need to add a new staff member to the list), they can click
on a custom menu button which opens frmLookup. frmLookup is a continuous form
that shows all the labels and filters in tblLookup. On this form, they simply
add a new record and enter the appropriate label (e.g., “Kevinâ€) and the
appropriate filter (e.g., “STAFFâ€). Then they close the form and return to
the main form.
The Form_Load code for frmLookup sets the visible property of the main form
to False, and the Form_Close code sets it back to visible.
The way it’s set up now, when the user returns to the main form, the combo
box isn’t refreshed with the updated list of values. He has to close the form
and then reopen it in order to see the updated list.
Because I have so many combo boxes, I would rather not code each one, or put
a button next to each one. Also, because I’d like the user to return to the
screen with the focus set to the control he was working on, I’d rather not
set the code to close the main form entirely and then reopen it.
Is there a way to refresh every possible combo box when the user closes
frmLookup? Or is it a better idea to: When they open frmLookup, save the
record they were working and close the main form, and when they close
frmLookup, reopen the main form (to the same screen/subform/control they
might have been on).
Thanks. (Code for frmLookup below.)
Kurt
Private Sub Form_Load()
Form_frmPatients.Visible = False
End Sub
Private Sub lblClose_Click()
DoCmd.Close , , acSaveYes
End Sub
Private Sub Form_Close()
Form_frmPatients.Visible = True
DoCmd.Maximize
End Sub