M
Mike Matheny
I am trying to populate a combo box with filtered names. Here is the deal -
I have a table named CustEquipment, that has a field named CtagID and one
named CID. This table has lots of equipment listed, all differentiated by
the CID (company ID) I am trying to get the combo box to only give the
equipment that is owned by a particular CID. I have a main form, named
frmMain, with a tab control and several subforms, such as Customer Info,
Hardware, Software, etc.On the main form, I have a Customer Name combo box
that selects all the customer names. I have placed a CID field on all the
subforms for debugging purposes, and when I select a customer in the
Customer Name combo box, all the info in all the subforms is updated with
the correct info for that company via the CID field. On one of the subforms
on the tab control (actually I haven't tried this on the other ones yet -
this is the one I am working on right now) I have a combo box that I want to
populate with only the CtagIDs of the currently selected CID. The CID field
is being populated correctly with the CID of the currently selected company.
The rowsource entry for the CtagID is:
SELECT CustEquipment.CtagID FROM CustEquipment WHERE
CustEquipment.CID=Me.CID;
Every time I click the combo box, it prompts me for the CID! If I enter the
correct CID, the combo box is populated correctly, but it never again
prompts me for the CID even when I change Company Names. I have other fields
on other subforms that are date fields, and when I double click on them and
pop up a calendar, I am able to populate the date field with the contents of
the calendar control by using Me.LastDate or Me.DueDate.
I'm sure it is me, so where am I going wrong?
I have a table named CustEquipment, that has a field named CtagID and one
named CID. This table has lots of equipment listed, all differentiated by
the CID (company ID) I am trying to get the combo box to only give the
equipment that is owned by a particular CID. I have a main form, named
frmMain, with a tab control and several subforms, such as Customer Info,
Hardware, Software, etc.On the main form, I have a Customer Name combo box
that selects all the customer names. I have placed a CID field on all the
subforms for debugging purposes, and when I select a customer in the
Customer Name combo box, all the info in all the subforms is updated with
the correct info for that company via the CID field. On one of the subforms
on the tab control (actually I haven't tried this on the other ones yet -
this is the one I am working on right now) I have a combo box that I want to
populate with only the CtagIDs of the currently selected CID. The CID field
is being populated correctly with the CID of the currently selected company.
The rowsource entry for the CtagID is:
SELECT CustEquipment.CtagID FROM CustEquipment WHERE
CustEquipment.CID=Me.CID;
Every time I click the combo box, it prompts me for the CID! If I enter the
correct CID, the combo box is populated correctly, but it never again
prompts me for the CID even when I change Company Names. I have other fields
on other subforms that are date fields, and when I double click on them and
pop up a calendar, I am able to populate the date field with the contents of
the calendar control by using Me.LastDate or Me.DueDate.
I'm sure it is me, so where am I going wrong?