J
jeff klein
On my "Orders" Form I have a command button that brings up a "Add Customer"
form that is sourced to "Customers" Table. After typing the name and
pressing the "Add" command button on this form the form closes and the new
costomer name is saved to a string (strNewName) that I have defined in
Module 1. The string I want to wright to the "Customer Name" combobox on
the order form when the Add Customer form has closed. This is the code in
the Add command button on the Add Customer form.
strNewName = ClientLastName + ", " + ClientFirstName
doCmd.Close
Forms!Orders!ClientFullName.SetFocus
Forms!Orders!ClientFullName.Text = strNewName
When the focus is returned to the Customer Name combo box on the orders form
I get an error message that the name is not on the list. Although when I
scroll down the list there it is and I can select it! I tried a Me.refresh
in the onfocus of the Customer Name combo box but this still does not work.
Maybe my problem lies with the combobox having the control source to
ClientID and the Row Source is :
SELECT DISTINCTROW Clients.ClientID, [ClientLastName] & ", " &
[ClientFirstName] AS ClientLastandFirst FROM Clients ORDER BY
[ClientLastName] & ", " & [ClientFirstName];
I know my explanation is lengthly although I think that the solution is
probably simple. Can anyone help me with this??
form that is sourced to "Customers" Table. After typing the name and
pressing the "Add" command button on this form the form closes and the new
costomer name is saved to a string (strNewName) that I have defined in
Module 1. The string I want to wright to the "Customer Name" combobox on
the order form when the Add Customer form has closed. This is the code in
the Add command button on the Add Customer form.
strNewName = ClientLastName + ", " + ClientFirstName
doCmd.Close
Forms!Orders!ClientFullName.SetFocus
Forms!Orders!ClientFullName.Text = strNewName
When the focus is returned to the Customer Name combo box on the orders form
I get an error message that the name is not on the list. Although when I
scroll down the list there it is and I can select it! I tried a Me.refresh
in the onfocus of the Customer Name combo box but this still does not work.
Maybe my problem lies with the combobox having the control source to
ClientID and the Row Source is :
SELECT DISTINCTROW Clients.ClientID, [ClientLastName] & ", " &
[ClientFirstName] AS ClientLastandFirst FROM Clients ORDER BY
[ClientLastName] & ", " & [ClientFirstName];
I know my explanation is lengthly although I think that the solution is
probably simple. Can anyone help me with this??