wrong values in combo box selection

  • Thread starter Thread starter Christopher Glaeser
  • Start date Start date
C

Christopher Glaeser

I thought my database had been working but I just now discovered a problem
with a combo box. I have two tables as follows:

tblTasks
TaskID :autonum
Status :long integer

tblStatus
StatusID :autonum
Status :string

tblStatus contains the following three entries:
1, "Open"
4, "Closed"
7, "Cancelled"

Note that tblStatus.StatusID is the primary key and unique, but not
sequential (due to a few deletions). The form frmTasks has a combo box to
select the Task Status, and I thought everything was working fine, but when
I looked at the data in tblTasks, the tblTasks.Status values are 1,2, or 3
and not 1,4, or 7 as I had expected. Where should I look to find the source
of this problem?

Best,
Christopher
 
Note that tblStatus.StatusID is the primary key and unique, but not
sequential (due to a few deletions). The form frmTasks has a combo box to
select the Task Status, and I thought everything was working fine, but when
I looked at the data in tblTasks, the tblTasks.Status values are 1,2, or 3
and not 1,4, or 7 as I had expected. Where should I look to find the source
of this problem?

Take a look at the RowSource and Control Source properties of the
combo box on the form: the rowsource should be either tblStatus or
something like

SELECT tblStatus.StatusID, tblStatus.Status ORDER BY Status;

and the Control Source should be the Status field in tblTasks.

John W. Vinson[MVP]
 
Take a look at the RowSource and Control Source properties of the
combo box on the form:

Thanks. I forgot I had implemented two tables for status, one for workorder
status and one for task status. I was using ADO and an SQL string for the
query, and looking at the RowSource reminded me of the correct spelling for
the correct table. Thanks!!!

Best,
Christopher
 
Back
Top