T
Tony_VBACoder
Is there a way with Access 2000, with a datasheet view of a subform, to have
a combo box have a different RowSource (this would be a Query) for each row
of data? The RowSource would change based on a value selected in another
column in that row.
For instance, if my Order Detail table has the following 2 columns:
1) ProductID
2) ProductOfferingID
When the user picks a ProductID, the ProductOfferingID's RowSource (query)
would change based on the ProductID selected. That way, the
ProductOfferingID would be based on the ProductID selected. I was thinking I
could code VBA code in the AfterUpdate event of the ProductID combo box to
change the RowSource of the ProductOfferingID combo box and do a Requery.
Then, in the OnCurrent event of the row, I would use the same logic so that
the ProductOfferingID combo box would be synched back up.
The reason for this is, the data for the ProductOfferingID comes from 3 or 4
different tables of data, and it is the ProductID that determines what table
I need to query. I initially thought I could create separate Queries for
each table that I would pull the data from, using the ProductID that the user
selected on the SubForm as the WHERE clause. But when I did this, something
strange happens on my SubForm as I move from record to record, or when I add
a new record; for each row in my SubForm, the ComboBox for my
ProductOfferingID field goes blank.
Is this even possible?
a combo box have a different RowSource (this would be a Query) for each row
of data? The RowSource would change based on a value selected in another
column in that row.
For instance, if my Order Detail table has the following 2 columns:
1) ProductID
2) ProductOfferingID
When the user picks a ProductID, the ProductOfferingID's RowSource (query)
would change based on the ProductID selected. That way, the
ProductOfferingID would be based on the ProductID selected. I was thinking I
could code VBA code in the AfterUpdate event of the ProductID combo box to
change the RowSource of the ProductOfferingID combo box and do a Requery.
Then, in the OnCurrent event of the row, I would use the same logic so that
the ProductOfferingID combo box would be synched back up.
The reason for this is, the data for the ProductOfferingID comes from 3 or 4
different tables of data, and it is the ProductID that determines what table
I need to query. I initially thought I could create separate Queries for
each table that I would pull the data from, using the ProductID that the user
selected on the SubForm as the WHERE clause. But when I did this, something
strange happens on my SubForm as I move from record to record, or when I add
a new record; for each row in my SubForm, the ComboBox for my
ProductOfferingID field goes blank.
Is this even possible?