display data

G

Guest

I cannot seem to remember how to do this.

In one database I have employee ids and their initials. in another, I have
employee id and customer orders. On the form they want to select the employee
every time. I have the form display the initials in a combo box with "SELECT
Employees.EmployeeID, Employees.Initials FROM Employees; " as the row source.
this works like how it is supposed to. The problem I am having is that in
another field on this form, a created field that is generated includes the
initials in it. I can get the rest of the field to generate properly, but
when it comes putting in the initials of the employee, it puts in the
employeeid and not the initials. the generated field contains
"=DatePart("m",[OrderDate],1) & DatePart("d",[OrderDate],1) &
DatePart("yyyy",[OrderDate],1) & [OrderID]" currently, because i had to take
out the employeed id until i get the initials to display properly. the
generated field needs to be able to change when the above combo box gets
modified.
 
L

Lee Robinson

It looks like the problem is that the "bound" column of your employee combo
box is EmployeeID. Therefore the value of the combo box will be the
EmployeeID rather than the initials. Would it be possible to change the
"Bound Column" property to column 2? Another option would be to do a look
up for the Initials based on the EmployeeID.
Still another is to refer to the column(2) of the combo box. This gets a
little more involved.

"=DatePart("m",[OrderDate],1) & DatePart("d",[OrderDate],1) &
DatePart("yyyy",[OrderDate],1) & [OrderID] &
me.cboEmployee.column(me.cboEmployee.listindex,1)

If I remember correctly, the second column is number 1, it starts at zero.

Lee Robinson
 
G

Guest

Sorry I am a little slow.The combo box name is EmployeeID. So would the code
say this then?
me.EmployeeID.column(me.EmployeeID.listindex,1)

Unfortunately, I cannot change the "bound" columns, because when I try it
mess up the display I want it to show. It needs to shows the initials in the
combo box.

Lee Robinson said:
It looks like the problem is that the "bound" column of your employee combo
box is EmployeeID. Therefore the value of the combo box will be the
EmployeeID rather than the initials. Would it be possible to change the
"Bound Column" property to column 2? Another option would be to do a look
up for the Initials based on the EmployeeID.
Still another is to refer to the column(2) of the combo box. This gets a
little more involved.

"=DatePart("m",[OrderDate],1) & DatePart("d",[OrderDate],1) &
DatePart("yyyy",[OrderDate],1) & [OrderID] &
me.cboEmployee.column(me.cboEmployee.listindex,1)

If I remember correctly, the second column is number 1, it starts at zero.

Lee Robinson

Herc said:
I cannot seem to remember how to do this.

In one database I have employee ids and their initials. in another, I have
employee id and customer orders. On the form they want to select the
employee
every time. I have the form display the initials in a combo box with
"SELECT
Employees.EmployeeID, Employees.Initials FROM Employees; " as the row
source.
this works like how it is supposed to. The problem I am having is that in
another field on this form, a created field that is generated includes the
initials in it. I can get the rest of the field to generate properly, but
when it comes putting in the initials of the employee, it puts in the
employeeid and not the initials. the generated field contains
"=DatePart("m",[OrderDate],1) & DatePart("d",[OrderDate],1) &
DatePart("yyyy",[OrderDate],1) & [OrderID]" currently, because i had to
take
out the employeed id until i get the initials to display properly. the
generated field needs to be able to change when the above combo box gets
modified.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top