vangogh228
Registered User.
- Local time
- Today, 03:56
- Joined
- Apr 19, 2002
- Messages
- 302
Based on a working example given to me, I have set up the following, in an attempt to be able to choose a Rep name from a combo box list and then see a list of that rep's customers for selection in the next combo box:
(Object Names are in bold, key fields in italics.)
Rep Table
Rep Number
Rep Name
Customer Table
Customer Number
Customer Name
Rep Code
There are more fields on the Customer Table, but the ones listed are enough for this example. I have a one-to-many relationship between <<Rep Table.Rep Number>> and <<Customer Table.Rep Code>>.
I then created the following Form object with two combo boxes, using the Combo Box Wizard:
Rep-Customer Form
Rep
Customers
On the form, the Rep field has the following Row Source property:
SELECT [Rep Table].[Rep Number], [Rep Table].[Rep Name] FROM [Rep Table];
The Column Count is 2; Column Widths are 0",1"; Bound Column is 1.
The form's Customer field has the following Row Source property:
SELECT [Customer Table].[Customer Number], [Customer Table].[Customer Name], [Customer Table].[Rep Code] FROM [Customer Table];
The Column Count is 3; Column Widths are 0",1",0"; Bound Column is 1.
The form's Rep field has the following After Update property:
Private Sub Rep_AfterUpdate()
Me.Customers.Requery
End Sub
This seems to be exactly how the example I was given operates to give a list of the right customers on the second combo box's dropdown when the first combo box list is chosen from. It works in the file I was given, but not on mine. Am I missing something??
One of my wife's pistachio cakes to whomever helps me get this!! Well... if it won't survive shipping, at least you can have the recipe!
Thanks to all in advance!!!
EDIT: Regarding the ReQuery issue: If I am going to REquery... don't I have to have an original query??? If so, on what do I query???
[This message has been edited by vangogh228 (edited 05-06-2002).]
(Object Names are in bold, key fields in italics.)
Rep Table
Rep Number
Rep Name
Customer Table
Customer Number
Customer Name
Rep Code
There are more fields on the Customer Table, but the ones listed are enough for this example. I have a one-to-many relationship between <<Rep Table.Rep Number>> and <<Customer Table.Rep Code>>.
I then created the following Form object with two combo boxes, using the Combo Box Wizard:
Rep-Customer Form
Rep
Customers
On the form, the Rep field has the following Row Source property:
SELECT [Rep Table].[Rep Number], [Rep Table].[Rep Name] FROM [Rep Table];
The Column Count is 2; Column Widths are 0",1"; Bound Column is 1.
The form's Customer field has the following Row Source property:
SELECT [Customer Table].[Customer Number], [Customer Table].[Customer Name], [Customer Table].[Rep Code] FROM [Customer Table];
The Column Count is 3; Column Widths are 0",1",0"; Bound Column is 1.
The form's Rep field has the following After Update property:
Private Sub Rep_AfterUpdate()
Me.Customers.Requery
End Sub
This seems to be exactly how the example I was given operates to give a list of the right customers on the second combo box's dropdown when the first combo box list is chosen from. It works in the file I was given, but not on mine. Am I missing something??
One of my wife's pistachio cakes to whomever helps me get this!! Well... if it won't survive shipping, at least you can have the recipe!
Thanks to all in advance!!!
EDIT: Regarding the ReQuery issue: If I am going to REquery... don't I have to have an original query??? If so, on what do I query???
[This message has been edited by vangogh228 (edited 05-06-2002).]