Form Query with tabs as criteria

crossy5575

Registered User.
Local time
Today, 02:05
Joined
Apr 21, 2015
Messages
46
Hi,
I have a simple query where there are 6 products, I want to show all of the results on a tabbed form split by product.
How do you do this via SQL so that you only use 1 query and change it for each tab?
ie tab 1 shows the query filtered to product 1 tab 2 shows product 2 etc.

next point - does it matter if the tab then has a subform on it? how would you do this in SQL

I have attached a database to show this - at the moment i have 6 queries populating the data, this will get messy if i have lots of products!
thanks

Simon
 

Attachments

If the tabs use the form record source, merely show the appropriate column on the appropriate tab. If each tab has a form and separate record source, filter each tab's (form) record source such that the appropriate column is displayed.
 
Thanks, however what coding do i use? so for example

qry = "SELECT data.transaction, data.Surname, data.Quantity, data.ID, price.Field1, [Quantity]*[Field1] AS Expr1" _
& "FROM price INNER JOIN data ON price.[ID] = data.[transaction]" _
& "WHERE (((data.transaction)=2));"

This filters the query and calls it "qry"
I now need to activate this and show it on say tab no 1 called unhelpfully 2 (tab nos start at 0)
This gives me an error?
Forms!form1.tabct10 (qry)
 

Users who are viewing this thread

Back
Top Bottom