S
sumthin_Missin
Okay, so let me preface this by saying that I've waded through tons and tons
of posts about cascading combo boxes, and I've come up with something that
works *mostly* except for this one display issue. Any help would be much
appreciated:
form Project List (saves to Projects table) contains cascading combos
[Customer] and [Location]
[Customer] Rowsource pulls from table "Customers":
SELECT [Customers].[ID], [Customers].[Customer Name] FROM Customers;
[Location] Rowsource pulls from table "Locations", filtered by the value of
the [Customer] combo box:
SELECT Locations.ID, Locations.Location_Name, Locations.Customer FROM
Locations WHERE (((Locations.Customer)=[Forms]![Project List].[Customer]))
ORDER BY Locations.Location_Name;
For the [Customer] combo box, I've added:
Private Sub Customer_AfterUpdate()
Me!Location.Requery
End Sub
Also, (not sure if this is necessary):
Private Sub Form_Current()
Me!Location.Requery
End Sub
On the Project List form (which is used in datasheet view), the data pulling
and saving works okay as far as I can tell, except that saved location values
are only displayed for rows that have the same customer value.
For instance, when the form loads, I see:
Cust 1 -- Loc 1
cust 1 -- Loc 2
Cust 2 -- BLANK
Cust 2 -- BLANK
(values exist in the Projects table, however, for all these rows)
If I click on one of the location combos on a row with customer 2, the
displayed values immediately shift to:
Cust 1 -- BLANK
Cust 1 -- BLANK
Cust 2 -- Loc A
Cust 2 -- Loc B
Note: Customers - Locations is a one-to-many relationship (locations are
unique to each customer)
I'm not sure if this is an Access 2007 issue or an issue with my form's
events or what. Any help would be much appreciated. Thanks!
of posts about cascading combo boxes, and I've come up with something that
works *mostly* except for this one display issue. Any help would be much
appreciated:
form Project List (saves to Projects table) contains cascading combos
[Customer] and [Location]
[Customer] Rowsource pulls from table "Customers":
SELECT [Customers].[ID], [Customers].[Customer Name] FROM Customers;
[Location] Rowsource pulls from table "Locations", filtered by the value of
the [Customer] combo box:
SELECT Locations.ID, Locations.Location_Name, Locations.Customer FROM
Locations WHERE (((Locations.Customer)=[Forms]![Project List].[Customer]))
ORDER BY Locations.Location_Name;
For the [Customer] combo box, I've added:
Private Sub Customer_AfterUpdate()
Me!Location.Requery
End Sub
Also, (not sure if this is necessary):
Private Sub Form_Current()
Me!Location.Requery
End Sub
On the Project List form (which is used in datasheet view), the data pulling
and saving works okay as far as I can tell, except that saved location values
are only displayed for rows that have the same customer value.
For instance, when the form loads, I see:
Cust 1 -- Loc 1
cust 1 -- Loc 2
Cust 2 -- BLANK
Cust 2 -- BLANK
(values exist in the Projects table, however, for all these rows)
If I click on one of the location combos on a row with customer 2, the
displayed values immediately shift to:
Cust 1 -- BLANK
Cust 1 -- BLANK
Cust 2 -- Loc A
Cust 2 -- Loc B
Note: Customers - Locations is a one-to-many relationship (locations are
unique to each customer)
I'm not sure if this is an Access 2007 issue or an issue with my form's
events or what. Any help would be much appreciated. Thanks!