M
Mark Andrews
Using Access2007 SP2
Here's how to duplicate this weird error (looking for suggestions to fix or
workarounds):
1. database with two tables tblContact and tblDonation (normal design with
ContactID foreignkey in tblDonation)
1. Have a datasheet on tblDonation with one control that is a combobox (use
to pick the contact associated with the donation).
with sql something close to:
Select tblContact.ContactID, tblContact.ContactName from tblContact
hide column 0 in the combobox
So you are looking at the donations made by all the contacts.
I named the control "ContactID" because certain functionality does NOT work
if you try to name it something
like "ComboContact". That's another Access2007 weird behavior.
In code:
2. Set the filter "[ContactID] IN (16,17,18)" Use three values that are
correct ContactID values
and then set the FilterON property to true
this works fine and should filter the list to the donations made by the 3
contacts
3. Try and sort the "ContactID" column by using the little arrow on the top
of the column
Notice it doesn't work
4. In code set the OrderBy property to ""
You will get error runtime error 3079 The specified field "|" could refer to
more than one table...
Would like #3 and #4 to work. Would prefer to filter instead of changing
the recordset (so I get the visual indicator that this column is being
filtered).
It has to do with how Access2007 deals with combo boxes in datasheets.
Example: the "ContactID" control for underlying field "ContactID" uses
[Lookup_ContactID] behind the scenes.
Any help is appreciated,
Mark
Here's how to duplicate this weird error (looking for suggestions to fix or
workarounds):
1. database with two tables tblContact and tblDonation (normal design with
ContactID foreignkey in tblDonation)
1. Have a datasheet on tblDonation with one control that is a combobox (use
to pick the contact associated with the donation).
with sql something close to:
Select tblContact.ContactID, tblContact.ContactName from tblContact
hide column 0 in the combobox
So you are looking at the donations made by all the contacts.
I named the control "ContactID" because certain functionality does NOT work
if you try to name it something
like "ComboContact". That's another Access2007 weird behavior.
In code:
2. Set the filter "[ContactID] IN (16,17,18)" Use three values that are
correct ContactID values
and then set the FilterON property to true
this works fine and should filter the list to the donations made by the 3
contacts
3. Try and sort the "ContactID" column by using the little arrow on the top
of the column
Notice it doesn't work
4. In code set the OrderBy property to ""
You will get error runtime error 3079 The specified field "|" could refer to
more than one table...
Would like #3 and #4 to work. Would prefer to filter instead of changing
the recordset (so I get the visual indicator that this column is being
filtered).
It has to do with how Access2007 deals with combo boxes in datasheets.
Example: the "ContactID" control for underlying field "ContactID" uses
[Lookup_ContactID] behind the scenes.
Any help is appreciated,
Mark