Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filter query to table values

Status
Not open for further replies.

ali32j

Technical User
Joined
Apr 23, 2007
Messages
97
Location
GB
Hi All

I have a table tblUser with multiple territory information only some of which are specific to the user signed in, so at the moment i m using a query with criteria [forms]![frmperf]![territory1] OR [forms]![frmperf]![territory2] filtering the query to only show user specific territory information in a sub form.

My question is, i need to filter the query without referencing a form field, but to look directly at the table itself to filter the query, is this possible? and if so can anyone give me some guidance?

Many thanks

Ali


 
I am not exactly sure what you mean, but I see no reason why you should not filter the table without referencing a form field:

SELECT FROM * Table WHERE User="Joe"
SELECT FROM * Table WHERE User=[Please enter user: ]

Perhaps you could explain a little more?
 
Also, if you have fields like territory1, territory2,etc your table is not normalized. You have repeating column headings. Another way to look at it is that territory1, territory2, etc. is a category so it should be a column or a table. In this case, probably a separate table.

See:
Fundamentals of Relational Database Design

for a start in how to create Access tables.

Your problem is because your table is not normalized. You'll encounter other problems in the future if the tables remain in an incorrect structure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top