Let me try to better explain this...
Table 1: Reports Current Period
Payback Report X(represents
yes/no check box)
Vendor Hold Report X
Time shees X
Table 2: Reports PD01 PD02
Payback Report X
Vendor Hold Report X
Time Sheets X
This was originally the update query I was trying to use but would not
work,
because if you add a report or drop a report on Table 2, it doesn't want
to
work right. (This update query DOES NOT include Table 1---Table 1 was
created
to try something different)
UPDATE [DSD- Month Close Reports] SET [DSD- Month Close Reports].[PD 02] =
[DSD- Month Close Reports]![PD 01], [DSD- Month Close Reports].[PD 03] =
[DSD- Month Close Reports]![PD 02], [DSD- Month Close Reports].[PD 04] =
[DSD- Month Close Reports]![PD 03], [DSD- Month Close Reports].[PD 05] =
[DSD- Month Close Reports]![PD 04], [DSD- Month Close Reports].[PD 06] =
[DSD- Month Close Reports]![PD 05], [DSD- Month Close Reports].[PD 07] =
[DSD- Month Close Reports]![PD 06], [DSD- Month Close Reports].[PD 08] =
[DSD- Month Close Reports]![PD 07], [DSD- Month Close Reports].[PD 09] =
[DSD- Month Close Reports]![PD 08], [DSD- Month Close Reports].[PD 10] =
[DSD- Month Close Reports]![PD 09], [DSD- Month Close Reports].[PD 11] =
[DSD- Month Close Reports]![PD 10], [DSD- Month Close Reports].[PD 12] =
[DSD- Month Close Reports]![PD 11];
Being the above SQL didn't work correctly, I created Table 1. I wanted to
do
an update query...
Field: []
Table: Table 2
Update To: [Table1]![Current Period]
I was hoping with the field being [], it would prompt me to enter a
parameter and would enter PD02 so it would drop the information into Table
2,
column PD02. But that's not how it worked.
Hopefully this better explained what I'm trying to accomplish. Any help is
appreciated.
Thank You
John W. Vinson said:
I have 2 tables...
Table 1: has two fields- "Reports" and "Current Period"- current period
is
yes/no.
Table 2: has 13 fields- "reports" and "PD 01-PD12"
Then your Table2 is *incorrectly designed*. Storing data - a period it
seems -
in a fieldname is fine for a spreadsheet but *simply wrong* for a
relational
table. "Fields are expensive, records are cheap".
I want to run an update query...I want to use Table 1 to update Table 2
depending on the Period...
If the period is Yes/No how does Access identify "the current period"?
I was hoping in my update query to link by report, and update table 2 to
"Current Period" in table 1. Is there any way not to specify the "FIELD"
in
the update query? For Example, in some queries you can use [] so it
prompts
parameters to be entered, can you do something like this to prompt what
field
it should be updated to?
I hope what I want to achieve makes some kind of sense. Please let me
know
if this can be done.
Stop. Step back. You're going about this in the wrong way, it appears!
You have a One (report) to Many (periods) relationship embedded within a
single record. Consider instead using a one to many relationship. What
Entities - real-life persons, things, or events - are represented by your
two
tables? What is a "reports" and what is a "period", and what is the
meaning
(again, in the real world) of "current period"?