I have a form with a Client Name combo box and a Client Code label. Whenever the user selects a Client Name from the combo box I populate the Client Code label with the coresponding value.
I need to allow them to edit any of the Client Name/Client Code combinations. To do that I pop up a form that has both a Client Name and Client Code text box. I do DAO database executes to update the table values (there are probably easier native Access ways to do this but I used to write VB6 code and am used to having to do ADO & SQL to the tables for everything).
This all works fine.
My problem is that when I Requery the Client Name combo box the new value doesn't display until the user selects a different Client Name and then selects the new one. For example: If I change a Client Name of "John Company" to "John's Company" I will still see "John Company" until I select a different name and then reselect "John's Company"
What I want is after the form I pop up (where I prompt for the changes) closes for the user to see the new value they changed to.
The code I use is this:
Private Sub cmbClient_DblClick(Cancel As Integer)
On Error GoTo Error_Handler
If Not cmbClient.Value & "" = "" Then
DoCmd.OpenForm FormName:="frmEditClient", _
WindowMode:=acDialog, _
OpenArgs:=UCase(Trim(cmbClient.Value)) & "~" & lblCode.Caption
cmbClient.Requery
End If
Exit_Procedure:
Exit Sub
Error_Handler:
DisplayErrorMessage Err.Number, Err.Description, "frmVoidedTickets", "cmbClient_DblClick"
Resume Exit_Procedure
Resume
End Sub
The form I pop up does all of the validation and table updates.
Thanks kindly in advance,
Marty
I need to allow them to edit any of the Client Name/Client Code combinations. To do that I pop up a form that has both a Client Name and Client Code text box. I do DAO database executes to update the table values (there are probably easier native Access ways to do this but I used to write VB6 code and am used to having to do ADO & SQL to the tables for everything).
This all works fine.
My problem is that when I Requery the Client Name combo box the new value doesn't display until the user selects a different Client Name and then selects the new one. For example: If I change a Client Name of "John Company" to "John's Company" I will still see "John Company" until I select a different name and then reselect "John's Company"
What I want is after the form I pop up (where I prompt for the changes) closes for the user to see the new value they changed to.
The code I use is this:
Private Sub cmbClient_DblClick(Cancel As Integer)
On Error GoTo Error_Handler
If Not cmbClient.Value & "" = "" Then
DoCmd.OpenForm FormName:="frmEditClient", _
WindowMode:=acDialog, _
OpenArgs:=UCase(Trim(cmbClient.Value)) & "~" & lblCode.Caption
cmbClient.Requery
End If
Exit_Procedure:
Exit Sub
Error_Handler:
DisplayErrorMessage Err.Number, Err.Description, "frmVoidedTickets", "cmbClient_DblClick"
Resume Exit_Procedure
Resume
End Sub
The form I pop up does all of the validation and table updates.
Thanks kindly in advance,
Marty