How to use unbound controls...

M

Manuel

I have a table tblCategories (CatID, CatName) and tblVehicles (VclID,
VclCatID, VclName)
As you probably guessed, they have a 1 to many relationship on
CatID=VclCatID.

Problem #1:
In a form I have to specify a Vehicle, on the table I obviously store only
the VclID but I want to have two comboboxes, one for the Category and one
for the Vehicles so when I pick a category only its vehicles show. I
(thought I) solved this by requerying the Vehicles combobox when the
cboCategory (unbound) changed (filling the cboVehicle with the corresponding
ones). It works when I'm adding stuff, but when I open the form to view the
data it clears both comboboxes. My guess is that it fills the cboCategory
and then the cboVehicle blanks out too because it doesn't find a match from
the selected category (blank at that moment.

What's the best way to solve this problem? (display the correct
Category/Vehicle when returning to the record)

Problem #2
In another form I have a subform (set on continuous form) where I specify
the Vehicle, once again I want to be able to select the category and fill
the cboVehicle with the ones that match the selected category. The problem
this time is that the unbounded control cboCategory is locked across all
subform's records! If I select a Category then all the cboCategory on all
rows become the same.

How can I display a Category cbo to filter the number of vehicles shown on
the cboVehicle inside a continuous subform?

Thank you.
 
M

Manuel

I fixed problem #1 with the Current event of the form. Using vba I opened a
recordset and got the corresponding values for both comboboxes and assigned
them their corresponding values "manually". imo this is kinda using brute
force, anyone has a better idea?

I just found out that the repeating values problem using continuous forms
also applies to labels. How can I have a per-line Total label?
 

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