By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,620 Members | 1,512 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,620 IT Pros & Developers. It's quick & easy.

Multiple combo boxes on Continuous Form

P: n/a
I have a Continuous Form based on the following table:

sku, description, categoryId, subCategoryId

I restrict the initial dataset to include one value for categoryId, but
it may include differing valuse for subCategoryId. The user needs to
be able to modify either Category or SubCategory.

I have placed two combo boxes on the form, they are query based and
linked to the two Id columns. The cboCategory displays category names
and updates the categoryId column, and works fine. The cboSubCategory
is linked to subCategoryId, and also works fine.

The problem that I am having is purely in the way the form appears
after data values are changed.

When the category changes I redefine the query that cboSubCategory is
based on and refresh the control. This allows the user to pick the
appropriate value. I am also redefining this query and refreshing in
the Form_Current event.

The data is such that subCategoryId's are unique.

The problems that I am encountering are that when cboCategory is
changed, all rows of cboSubCategory are blanked. When selecting
cboCategory on another row, where all entries are of the initial value,
all the cboSubCategories are repopulated correctly.

I hope that's somewhat clear . . .

Here's the code from the form:

Private Sub cboCategory_Change()

CurrentDb.QueryDefs("qryGetSubCategoryByCategory") .SQL = "EXEC
getCategoryByCategory" & Me.categoryId

Me.cboSubCategory.Requery
End Sub

Private Sub Form_Current()

CurrentDb.QueryDefs("qryGetSubCategoryByCategory") .SQL = "EXEC
getCategoryByCategory" & Me.categoryId

Me.cboSubCategory.Requery
End Sub

Sure would appreciate any help.

Oct 4 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I have a Continuous Form based on the following table:
>
sku, description, categoryId, subCategoryId

I restrict the initial dataset to include one value for categoryId, but
it may include differing valuse for subCategoryId. The user needs to
be able to modify either Category or SubCategory.

I have placed two combo boxes on the form, they are query based and
linked to the two Id columns. The cboCategory displays category names
and updates the categoryId column, and works fine. The cboSubCategory
is linked to subCategoryId, and also works fine.

The problem that I am having is purely in the way the form appears
after data values are changed.

When the category changes I redefine the query that cboSubCategory is
based on and refresh the control. This allows the user to pick the
appropriate value. I am also redefining this query and refreshing in
the Form_Current event.

The data is such that subCategoryId's are unique.

The problems that I am encountering are that when cboCategory is
changed, all rows of cboSubCategory are blanked. When selecting
cboCategory on another row, where all entries are of the initial value,
all the cboSubCategories are repopulated correctly.

I hope that's somewhat clear . . .

Here's the code from the form:

Private Sub cboCategory_Change()

CurrentDb.QueryDefs("qryGetSubCategoryByCategory") .SQL = "EXEC
getCategoryByCategory" & Me.categoryId

Me.cboSubCategory.Requery
End Sub

Private Sub Form_Current()

CurrentDb.QueryDefs("qryGetSubCategoryByCategory") .SQL = "EXEC
getCategoryByCategory" & Me.categoryId

Me.cboSubCategory.Requery
End Sub

Sure would appreciate any help.
The article at the following link explains it quite well and describes
a workaround:

http://www.fmsinc.com/free/newtips/a...ccesstip16.asp

HTH,
Bruce

Oct 5 '06 #2

P: n/a
Thanks for the info. Their workaround is OK, just not what the user
asked for.

Looks like the choice of Access for this job was the wrong one.

Oct 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.