-----Original Message-----
Does that mean you've resolved the compile error?
Now another question. If i have two
combo boxes and when i pick one item in the first combo
box, i automatically want the second combo box to show the
corresponding number. i have the first combo box showing
but nothing comes up in the second box. What am I doing
wrong
I'll have to ask a bit more about how you have this set up. If the
value in the second combo box is completely dependent on the first combo
box, then I don't think you should be using a combo box for this second
value at all. Rather, you should be using a text box that shows the
calculated value. If you include that value as an extra column in the
first combo box, then the second combo box can pick it up from that
column via a controlsource expression.
For example, suppose you have a table of Employees like this:
Table: Employees
Field: EmpID
Field: EmpName
Field: EmpSSN
And you have a combo box to pick an employee by name and save the EmpID
in its bound field:
Combo box: cboEmployee
ControlSource: EmpID
RowSource: SELECT EmpID, EmpName, EmpSSN
FROM Employees ORDER BY EmpName;
ColumnCount: 3
BoundColumn: 1
ColumnWidths: 0"; 2"; .5"
Then you could also have text box on the form to show the SSN for the
selected employee:
Text box: txtEmpSSN
ControlSource: =[cboEmployee].[Column](2)
Note that the expression refers to column 2, because in VBA code the
columns of the combo box are numbered starting from 0.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
.
Thanks for all your help but I was able to figure it out.