Really simple query

  • Thread starter Thread starter Gary Davidson
  • Start date Start date
G

Gary Davidson

Its so simple I wonder if I should really be posting it.

I have a form where the user selects if the hardware is a server or
client, depending on the results the sub category displays all the
Server models or all the client models.

Problem is I can't seem to get the query right, what I have at the
moment asks me for a Parameter?

I have an SQL statement to display server or client,
SELECT [tblProductID].[ProductID], [tblProductID].[ProductType] FROM
tblProductID;
Works fine.

Once they have chosen Server or Client, select from sub category
SELECT [tblServer].[Server] FROM tblServer WHERE
[tblProductID].[ProductType] ="Server";

The above will also need to include the client table, so its is only
half the job, but I want to get this bit right first before
complicating matters.

Am I missing something obvious or going about this the wrong way? Im
a novice so be gentle.

Many thanks

Gary
 
Hi Gary,

I think you are asking how query use value from a form.
The answer is

[Forms]![FormName]![FormField]

So your query will be (let's the form name is "Testing" and Field on the
form is "FieldA", then.

SELECT [tblServer].[Server] FROM tblServer WHERE
[tblProductID].[ProductType] = [Forms]![Testing]![FieldA];

Hope this helps.
 
Back
Top