I need help

  • Thread starter Thread starter leoklodi
  • Start date Start date
L

leoklodi

Guest
i have two table one were i record sales and one were i have my employee names. What i need is that when I select a certain store I want only the employees of tha store to show up not my whole list of employees for all my stores. Can I do that??

I am really dumn on access so I really need help>


Thank YOu in advance
 
You can set up your tables like this:

TBL 1
storeID (PK)
Store name
etc

TBL 2
StoreID (FK)(from TBL1)
Emloyee ID
Employeename
etc

Then you have a relation that should work for you. The employee ID might be useful later on if you want more functions in your db.

Fuga.
 
sure is!

im going to assume that you'll use two list boxes (combo boxes are the same)

list1: contains the stores
list 2: contains the names of employees

on the table with employees, you should have a field that specifies which store that employee belongs to

go to the properties of the employee list box and under the data tab, click the ...
that brings you to the SQL builder where you can lay your list contents out - the trick is:
under the criteria part of store name type this:

Like [forms]![nameofyourform].[nameofthelistwithstores]

finally:
go to the events tab under the properties of the list with the stores, click the ... of the afterupdate event and use the code builder

(assuming list2 is what you named your list with the employee names)
enter this code:

me!list2.requery


that should do it - i hope i didnt confuse you
i'm just learning this stuff too (thanks to the help of many people from this forum)


what fuga said is really good too - you want to set up the relationships between the two tables so you can be able to do more with the database later
 
Last edited:

Users who are viewing this thread

Back
Top Bottom