Add data from field to table, from a variable field in form

R

Rishi

Hi,

First of all, I'm a bit a of a newbie in Access, so if this is a stupid
question, do accept my apologies.

Is there a way that I can design a query which adds data to a table in such
a way that the field (in a form) can be different

In the expression:
INSERT INTO TEST ( Hour)
SELECT [Forms]![Form1]![Even4] AS Expr2
FROM TESTRooster, [scedule];
I want to specify the fieldname in form1 which is calculated:
So [Even4] is the result of a calculation.

In Excel there we have the INDIRECT function.
Is there something like this in Access?

Rishi
 
K

KARL DEWEY

You can not specify a field name this way.
You can use a union query with criteria like this --
SELECT [XYZ] AS Expr2
FROM [QMD]
WHERE [Forms]![Form1]![Even4] = 1
UNION SELECT [ABC] AS Expr2
FROM [QMD]
WHERE [Forms]![Form1]![Even4] = 2;


Another thing you are saying you want the data from two tables -
TESTRooster and [scedule] (probably spelled wrong)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top