I have a form with a field of categories populated from a drop down box. I have created a button for users to click when they wish to add a new category. This opens a query in alphabetical order, which they can then add a new category to the bottom of.
I would like the users to be able select the record they want, and then be able to add the new category if necessary by cicking the button, then the query closing down and the same record still showing on the screen.
I have tried adding requery to the button on exiting the button, but that just clears the screen completely of any record. I've also tried adding me.requery to on click, but that doesn't show the new category on the form in my field.
The code I now have is:
Private Sub Command31105_Click()
On Error GoTo Err_Command31105_Click
Dim stDocName As String
stDocName = "Q_resource_categories"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Me.Requery
Exit_Command31105_Click:
Exit Sub
Err_Command31105_Click:
MsgBox Err.Description
Resume Exit_Command31105_Click
End Sub
Can anyone tell me how to refresh the list without losing the record already on the screen? Thank you.
I would like the users to be able select the record they want, and then be able to add the new category if necessary by cicking the button, then the query closing down and the same record still showing on the screen.
I have tried adding requery to the button on exiting the button, but that just clears the screen completely of any record. I've also tried adding me.requery to on click, but that doesn't show the new category on the form in my field.
The code I now have is:
Private Sub Command31105_Click()
On Error GoTo Err_Command31105_Click
Dim stDocName As String
stDocName = "Q_resource_categories"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Me.Requery
Exit_Command31105_Click:
Exit Sub
Err_Command31105_Click:
MsgBox Err.Description
Resume Exit_Command31105_Click
End Sub
Can anyone tell me how to refresh the list without losing the record already on the screen? Thank you.