Bound form & blank combo box

O

Opal

I can't seem to figure this one out and I really don't know where to
begin to look to find the answer.... I am running Access 2003.
I have a bound form with 3 combo boxes. One combo box is
"filtered" based on what the user selects in the previous 2 combo
boxes:

Combo 1: cboType
Combo 2: cboArea
Combo 3: cboAsset

The SQL for cboAsset is:

SELECT Asset.AssetID, Asset.Asset, Asset.TypeID, Asset.AreaID,
FROM Asset
WHERE (((Asset.TypeID)=[Forms]![frmDataInput]![cboType]) AND
((Asset.AreaID)=[Forms]![frmDataInput]![cboArea]));

It works fine, but, when the user scrolls back through previous
records
on the form, cboAsset is blank, even though there is data in this
field in
table. If I remove the "WHERE" clause, the cboAsset is no longer
blank
for all records, but then the user has to scroll through 1300 records
in
this combo box, instead of a dozen or so. What have I missed?
 
B

Beetle

Requery the combo box in the Current event of the form;

Private Sub From_Current ()

Me!cboAsset.Requery

End Sub
 
O

Opal

Requery the combo box in the Current event of the form;

Private Sub From_Current ()

   Me!cboAsset.Requery

End Sub
--
_________

Sean Bailey



Opal said:
I can't seem to figure this one out and I really don't know where to
begin to look to find the answer....  I am running Access 2003.
I have a bound form with 3 combo boxes.  One combo box is
"filtered" based on what the user selects in the previous 2 combo
boxes:
Combo 1:  cboType
Combo 2: cboArea
Combo 3:  cboAsset
The SQL for cboAsset is:
SELECT Asset.AssetID, Asset.Asset, Asset.TypeID, Asset.AreaID,
FROM Asset
WHERE (((Asset.TypeID)=[Forms]![frmDataInput]![cboType]) AND
((Asset.AreaID)=[Forms]![frmDataInput]![cboArea]));
It works fine, but, when the user scrolls back through previous
records
on the form, cboAsset is blank, even though there is data in this
field in
table.  If I remove the "WHERE" clause, the cboAsset is no longer
blank
for all records, but then the user has to scroll through 1300 records
in
this combo box, instead of a dozen or so.  What have I missed?- Hide quoted text -

- Show quoted text -

Thank you so much....I thought I was going to lose my mind!!
 
B

Beetle

Glad I could help.
--
_________

Sean Bailey


Opal said:
Requery the combo box in the Current event of the form;

Private Sub From_Current ()

Me!cboAsset.Requery

End Sub
--
_________

Sean Bailey



Opal said:
I can't seem to figure this one out and I really don't know where to
begin to look to find the answer.... I am running Access 2003.
I have a bound form with 3 combo boxes. One combo box is
"filtered" based on what the user selects in the previous 2 combo
boxes:
Combo 1: cboType
Combo 2: cboArea
Combo 3: cboAsset
The SQL for cboAsset is:
SELECT Asset.AssetID, Asset.Asset, Asset.TypeID, Asset.AreaID,
FROM Asset
WHERE (((Asset.TypeID)=[Forms]![frmDataInput]![cboType]) AND
((Asset.AreaID)=[Forms]![frmDataInput]![cboArea]));
It works fine, but, when the user scrolls back through previous
records
on the form, cboAsset is blank, even though there is data in this
field in
table. If I remove the "WHERE" clause, the cboAsset is no longer
blank
for all records, but then the user has to scroll through 1300 records
in
this combo box, instead of a dozen or so. What have I missed?- Hide quoted text -

- Show quoted text -

Thank you so much....I thought I was going to lose my mind!!
 

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