C
camelman
Guest
I have a bound CONTINUOUS FORM with 2 comboboxes on it.
A [company] combobox and a [company_member] combobox.
If you select a company it should update the rowsource of the [company_member] box to only show the members in that company.
CmboCompany: select company.companyName, company.companyID from company
CmboCompanyMember: select member.surname, member.memberID from member where member.companyID = forms![sales]![companyID]
the column width of column 1 in both boxes is 0 so that they show meaningful names and not ID numbers to the user.
Limit to list is set to true because access doesn't allow it to be false if you have multiple columns in your select statement.
The "On enter" event on the CmboCompanyMember says "CmboCompanyMember.requery" so that it always shows the records for the correct company.
You are probably thinking "This all sounds well implemented and should have no problems!"
Well ... here's the problem.
On a single form this works perfectly. On a continuous form we have a slight problem.
PROBLEM:
Lets say the continous form looks like this.
COMPANY MEMBER
row1 mcdonalds Jon
row2 Ceres Bob
row3 I&J Fred
row4 mcdonalds Frank
These 3 records are shown at the same time (being a continous form)
CmboCompanyMember, as a form object, can only contain 1 rowsource, yet on our screen we have 3 instances of CmboCompanyMember.
This means that all 3 instances have the same rowsource.
Therefore when the rowsource contains all the members from Ceres
(select member.surname, member.memberID from member where member.companyID = 2)
Bob and Fred become invalid records for the combobox.
ie: the limit to list causes access to go "Hey, Bob and Fred aren't in the list for this combobox, what the hell are they
doing on this form"
What then happens is the comboboxes all show blank values (although the underlying bound value still remains).
As you click into a box, it shows its correct value (because the rowsource is updated).
If you click into the row1 box, both row1 and row4 show their values because the rowsource is valid for both McDonalds records.
NB: If you give the 1st column in CmboCompanyMember a width then this whole problem doesnt happen.
Unfortunately you are then stuck looking at member no 154 trying to work out who he is so this is not really any good.
At the moment when I go into my form, almost all of the combo boxes are showing blanks even though they have values.
Workaround: I have used a dlookup text box (looking up the guys name) next to a combobox which shows you the member_id.
This works but the form becomes incredibly slow. Especially if you have a few of these on the same form.
I can't use that as my solution because it is just too slow.
Help ?
Please ?
A [company] combobox and a [company_member] combobox.
If you select a company it should update the rowsource of the [company_member] box to only show the members in that company.
CmboCompany: select company.companyName, company.companyID from company
CmboCompanyMember: select member.surname, member.memberID from member where member.companyID = forms![sales]![companyID]
the column width of column 1 in both boxes is 0 so that they show meaningful names and not ID numbers to the user.
Limit to list is set to true because access doesn't allow it to be false if you have multiple columns in your select statement.
The "On enter" event on the CmboCompanyMember says "CmboCompanyMember.requery" so that it always shows the records for the correct company.
You are probably thinking "This all sounds well implemented and should have no problems!"
Well ... here's the problem.
On a single form this works perfectly. On a continuous form we have a slight problem.
PROBLEM:
Lets say the continous form looks like this.
COMPANY MEMBER
row1 mcdonalds Jon
row2 Ceres Bob
row3 I&J Fred
row4 mcdonalds Frank
These 3 records are shown at the same time (being a continous form)
CmboCompanyMember, as a form object, can only contain 1 rowsource, yet on our screen we have 3 instances of CmboCompanyMember.
This means that all 3 instances have the same rowsource.
Therefore when the rowsource contains all the members from Ceres
(select member.surname, member.memberID from member where member.companyID = 2)
Bob and Fred become invalid records for the combobox.
ie: the limit to list causes access to go "Hey, Bob and Fred aren't in the list for this combobox, what the hell are they
doing on this form"
What then happens is the comboboxes all show blank values (although the underlying bound value still remains).
As you click into a box, it shows its correct value (because the rowsource is updated).
If you click into the row1 box, both row1 and row4 show their values because the rowsource is valid for both McDonalds records.
NB: If you give the 1st column in CmboCompanyMember a width then this whole problem doesnt happen.
Unfortunately you are then stuck looking at member no 154 trying to work out who he is so this is not really any good.
At the moment when I go into my form, almost all of the combo boxes are showing blanks even though they have values.
Workaround: I have used a dlookup text box (looking up the guys name) next to a combobox which shows you the member_id.
This works but the form becomes incredibly slow. Especially if you have a few of these on the same form.
I can't use that as my solution because it is just too slow.
Help ?
Please ?