When I click on an Authorized Contact or Location
well, i don't know what you mean by the above. what specifically are you
doing? and where specifically? and did you apply the Requery action to the
combo box's Enter event, rather than to an event of the subform object or
the subform control?
hth
message Thanks Tina. I forgot to apply the Requery action on the combo box. That
worked great. The records displayed are now specific for that customer.
I am having a new issue since adding the Requery action. When I click on
an
Authorized Contact or Location I get the following error message:
"You can't use the ApplyFilter action on this window"
Any thoughts or ideas?
:
no, tabs should not make a difference in this situation - but thanks for
mentioning it (when in doubt, it's always better to include info we
don't
need, than to leave out info we *do* need).
sounds like the combo box on the subform is being filtered when the form
opens, but not subsequently. did you set a Requery action on the combo
box's
Enter event, as i suggested?
hth
message Again thank you for all your help.
Getting Closer. The Locations displayed are for CustomerID=1 now
matter
what
customer is selected.
I forgot to mention that I am using tabs on my form. I don't know if
this
has any effect. I apologize for not mentioning and if this is a
problem.
:
well, i think i'm getting my syntax mixed up. let's try
SELECT [Locations].[LocationID], [Locations].[lLocationName] FROM
Locations
WHERE CustomerID = Forms!frmCustomerInformation!CustomerID
and we probably want to requery the combo box on its' Enter event,
so
the
list will always be correct for the current record.
assuming that all the referenced names in your SQL statement are
correct,
the above should work. (on the other hand, seems like the SQL i gave
should
have erred out and not returned any records, rather than all of
them -
so
let's just wait and see!)
hth
in
message Thanks for the response. I followed your suggestion however, I
still
get
the
entire locations list. I have included the RowSource below.
The Primary Key on my tblCustomerInformation is "CustomerID".
The Primary Key on my tblLocations is "LocationID"
SELECT [Locations].[LocationID], [Locations].[lLocationName] FROM
Locations
WHERE CustomerID = " & Forms!frmCustomerInformation!CustomerID &
";
Again, any help is very much appriciated.
:
your tblLocations should have a foreign key field that holds the
primary
key
value of the related CustomerInformation record. i'll call that
field
fkCustInfoID
in your combo box's RowSource, add a Where clause to filter the
locations
based on the customer ID of the current record on
frmCustomerInformation.
something like
WHERE fkCustInfoID = " & Forms!frmCustomerInformation!CustInfoID
(the above assumes that the primary key field of the
CustomerInformation
table is a Number or Autonumber data type.)
hth
"Douglas Merrill" <
[email protected]>
wrote
in
message
I hope this is explained well.
I have created a Customer Contact database. I have 3 specific
tables
that
I
am focused on.
Tables:
tblCustomerInformation
tblLocations
tblAuthorizedContacts
Sub-Forms:
frmLocations
frmAuthorizedContacts
I created a form (frmCustomerInformation) and added the fields
from
the
table "tblCustomerInformation". I added 2 subforms
"frmLocations"
and
"frmAuthorizedContacts". When I select a customer, their
specific
information
(CustomerInformation, Locations and Authorized Contacts) is
displayed.
The locations sub-form is used to add each location of my
customers
offices.
On the Authorized Contacts form I have a drop down
"PrimaryLocation".
The
values of the drop down should only list the locations from
the
locations
table for that specific customer. Instead it displays all
locations.
How
can
I fix this?
Any help would be appreciated.
Doug