Solved want the record to show me the customer name not the id number

rainbows

Registered User.
Local time
Today, 03:20
Joined
Apr 21, 2017
Messages
428
one on the guys on here really helped me create some code that went into the form " acknowledge order" i have now copied that code to the " enter order details
the problem i have is that the when i create a text box to look for the customer name it gives me the ID number for that customer not the name . how can i create box to give me the name . then the code will look at that name . the form name is called orders that has the dropdown box in it

i thought you had to look at the column and the second row but i dont know how to do it the code below is a peice that i copied for the from acknowledge order"
Code:
 varFolder = varFolder & "\" & Year(Date) & "\" & [Order detials subform]![CustomerName

thanks steve

1675953510855.png






1675949349570.png




1675949463222.png
 
It's the column index of your combo, and the numbering starts at 0
So from the main form it would be something like

Me.YourSubformControlName.cmbCustomer.Column(1)

Assuming that the customer name is in Column 2 in the rowsource of the combobox.
 
To use the combo box to pull down various fields from the .RowSource, you use the COLUMN() property:


With very few exceptions, indexes in Access are zero-based, so the first (left-most) column is column(0). If you have made a single selection, the default is for you to see the columns in the row you selected. Therefore, if you have an ID in the first column and a name in the second column of that combo, you can direct-address it using the COLUMN() property.

NOTE: If you have a multi-column situation that also allows multi-select then you have to use both the column and row numbers, which is a far more complex situation.
 

Users who are viewing this thread

Back
Top Bottom