I’ve added a lookup column with the name Customer ID to the table “orders†where data get added as a new customer is added.
This add ups more text filed to my form create new invoice. Ive also added text boxes to the form where when the customer ID is selected from the combo box the corresponding text boxes to be filled from the customers query table.
Here is the code I’m using so far but I’m getting error messages with this
* The combo box only has one column so you can't retrieve data from the other columns. You need to add extra columns to the row source of the combo, and increase its number of columns.
* You don't need any code in the after update event, because you are not copying the values into fields in the orders table. All you are doing (correctly) is displaying them on the form. The existing control sources will do that without any code ( as long as the column numbers are correct.)
I've set the Row Source of the combo box to "Customers Query" table as it contains the column "Customer Name". And set the column count property to 9. With this situation all the fields get filled as required. But If I set the column count property as 1 only one filed gets field.
My intention for the combo box customer ID is to show only one column (the column containing the customer ID)but fill all the text boxes.
Yes, it can. Set the Column Count property to 9, and use the Column Widths property to determine which columns are displayed and which are hidden. A column width of 0 hides a column.
If you only want to display the second column (assuming that the first column is the Customer ID, which you probably want to hide), set the Column Widths property to
0";1";0";0";0";0";0";0";0"
If you want to display the first and second columns, and hide the rest, use
I’m trying to populate the user ID text box in the “create new invoice†form with corresponding data from the column “Record C No†in employees table.
But my formulas aren’t working.
Which means; when I select the employee name from the combo box that is bound to the table “ordersâ€, the texbox User ID will get populated with the appropriate Record C No from the employees table.
You do not have the required permissions to view the files attached to this post.
I don't see why you need the text box, but the expression =[lngEmpID].[column](2) refers to the THIRD column of the combo box, for the column index starts counting at 0: Column(0) is the first column, Column(1) is the second column, etc.
Since the combo box has two columns (Column Count = 2), there is no point in referring to the third column. If you want to refer to the second column, use =[lngEmpID].[column](1)
Hans, I Still do not get the corresponding “Record C No†from the employees table when I select the employee name from the combo box that is bound to the table “orders�
For example when I set the expression
=[lngEmpID].[column](2) to =[lngEmpID].[column](0) I get the primary key Number. But when I set the expression to =[lngEmpID].[column](10) which is the column where the “Record C No†resides, I don’t get any figure on the text box User ID?
My intention is to get the number 4754 when I select Adam as the Bill User.
You do not have the required permissions to view the files attached to this post.
SELECT [lngEmpID], [First Name] FROM tblEmployees ORDER BY [First Name];
This selects only 2 (TWO) fields from tblEmployees. Moreover, you have set the Column Count property of the combo box to 4. So it stands to reason that referring to Column(10) won't work.
Set the Format property of the Product Code field in the table and of the text box bound to this field to the custom format 0000
You can't select this format from the dropdown list, but you can type it in yourself.