Hi There
I wonder if anyone can help me. I have a combo box that I want to populate with a new value(s) if the item is not in the list for the user. I am using the code below.
The problem is on the double click event, i open the relevant form allowing the user to create a new record, say staff member and close the form with a save. On closing the form the new entry appears in the combo list for the user to select, however, if the user wants to select another value (from the same combo box), the new value does NOT appear. What is it that I'm doing wrong or ommitted! Please help!
Code:
Private Sub StaffID_DblClick(Cancel As Integer)
Dim Response As String
Response = MsgBox("You are about to add another record to the list. Are you sure you want to do this!", vbYesNo, "Creating another staff member")
If Response = vbYes Then
DoCmd.OpenForm "frmStaff"
DoCmd.GoToRecord , , acNewRec
Forms![frmStaff].Refresh
Else
End If
End Sub
I wonder if anyone can help me. I have a combo box that I want to populate with a new value(s) if the item is not in the list for the user. I am using the code below.
The problem is on the double click event, i open the relevant form allowing the user to create a new record, say staff member and close the form with a save. On closing the form the new entry appears in the combo list for the user to select, however, if the user wants to select another value (from the same combo box), the new value does NOT appear. What is it that I'm doing wrong or ommitted! Please help!
Code:
Private Sub StaffID_DblClick(Cancel As Integer)
Dim Response As String
Response = MsgBox("You are about to add another record to the list. Are you sure you want to do this!", vbYesNo, "Creating another staff member")
If Response = vbYes Then
DoCmd.OpenForm "frmStaff"
DoCmd.GoToRecord , , acNewRec
Forms![frmStaff].Refresh
Else
End If
End Sub