Update to Box in update query

T

troy

Can someone explain the grid on the update query.

Does it go like this..

1. field: what field you want updated
2. Table: The table from #1 (above) field
3. Update 2: In my case I have 14 fields I want updated if a user update any
one of the fileds I have in my query. Would each one look like this?
[DEV_dbo_TblProduct].[FormId] where the "DEV_dbo_tblProducts"and ".[FormId]"
would be the same as #1 and #2 above?
Criteria: I would like to put the crteria as if anything is typed in new
into the tables. When I run the query it would update my table named:
DEV_dbo_TblProduct from #2 and #3 above. Would this cretreia work under each
field? <>([dbo_tblProduct].[productid]) Thank you in advance and I almost
have it!
 
G

Gary Walter

troy said:
Can someone explain the grid on the update query.

Does it go like this..

1. field: what field you want updated
2. Table: The table from #1 (above) field
3. Update 2: In my case I have 14 fields I want updated if a user update
any
one of the fileds I have in my query. Would each one look like this?
[DEV_dbo_TblProduct].[FormId] where the "DEV_dbo_tblProducts"and
".[FormId]"
would be the same as #1 and #2 above?
Criteria: I would like to put the crteria as if anything is typed in new
into the tables. When I run the query it would update my table named:
DEV_dbo_TblProduct from #2 and #3 above. Would this cretreia work under
each
field? <>([dbo_tblProduct].[productid]) Thank you in advance and I almost
have it!

I don't have a suggestion, but just
by providing a response, I'm sure
someone will read this.
 
G

Gary Walter

troy said:
Can someone explain the grid on the update query.

Does it go like this..

1. field: what field you want updated
2. Table: The table from #1 (above) field
3. Update 2: In my case I have 14 fields I want updated if a user update
any
one of the fileds I have in my query. Would each one look like this?
[DEV_dbo_TblProduct].[FormId] where the "DEV_dbo_tblProducts"and
".[FormId]"
would be the same as #1 and #2 above?
Criteria: I would like to put the crteria as if anything is typed in new
into the tables. When I run the query it would update my table named:
DEV_dbo_TblProduct from #2 and #3 above. Would this cretreia work under
each
field? <>([dbo_tblProduct].[productid]) Thank you in advance and I almost
have it!
Hi Troy,

It appears you have 2 tables

1) dbo_tblProduct

which is possibly a link to a SQL table?

2) DEV_dbo_TblProduct

possibly a local Access table that shares
14 fields in common with to the first table

and you would like to update the 14 fields
in DEV_dbo_TblProduct to the current
values of the corresponding fields in dbo_tblProduct?

Is the above correct?

If so, is there a field (or fields) that they share in
common that determines a distinct row in each
table, and a distinct row match between tables?

I might start the update query with a simple SELECT
query where you join the 2 tables on those fields,
then bring down the 14 fields from each table,
and in Criteria row under DEV_dbo_TblProduct
fields, type in as you said

Field: field1
Table: DEV_dbo_TblProduct
Sort:
Show: <checked>
Criteria: <> dbo_tblProduct.correspondingfield1
Or:

Once verified that SELECT query is returning
correct records to be updated (and you can see
field values from both fields to check), then
delete the fields from dbo_tblProduct from grid,
change your query to an Update query, and
fill in Update To: row under remaining "DEV" fields in grid.

Field: field1
Table: DEV_dbo_TblProduct
Update To: dbo_tblProduct.correspondingfield1
Criteria: <> dbo_tblProduct.correspondingfield1
Or:

Actually, on many occasions, if fields share
same names, Access will do a pretty good
job filling them in with best guess from the join
when you change to Update query.

good luck,

gary
 
G

Gary Walter

Hi Troy,

the important thing is that you *OR*
all the criteria

Field: f1 f2 f3 f4
Table: t1 t1 t1 t1
Update To: t2.f1 t2.f2 t2.f3 t2.f4
Criteria: <> t2.f1
Or: <>t2.f2
Or: <>t2.f3
Or: <>t2.f4



"Gary Walter"wrote
troy said:
Can someone explain the grid on the update query.

Does it go like this..

1. field: what field you want updated
2. Table: The table from #1 (above) field
3. Update 2: In my case I have 14 fields I want updated if a user update
any
one of the fileds I have in my query. Would each one look like this?
[DEV_dbo_TblProduct].[FormId] where the "DEV_dbo_tblProducts"and
".[FormId]"
would be the same as #1 and #2 above?
Criteria: I would like to put the crteria as if anything is typed in new
into the tables. When I run the query it would update my table named:
DEV_dbo_TblProduct from #2 and #3 above. Would this cretreia work under
each
field? <>([dbo_tblProduct].[productid]) Thank you in advance and I
almost
have it!
Hi Troy,

It appears you have 2 tables

1) dbo_tblProduct

which is possibly a link to a SQL table?

2) DEV_dbo_TblProduct

possibly a local Access table that shares
14 fields in common with to the first table

and you would like to update the 14 fields
in DEV_dbo_TblProduct to the current
values of the corresponding fields in dbo_tblProduct?

Is the above correct?

If so, is there a field (or fields) that they share in
common that determines a distinct row in each
table, and a distinct row match between tables?

I might start the update query with a simple SELECT
query where you join the 2 tables on those fields,
then bring down the 14 fields from each table,
and in Criteria row under DEV_dbo_TblProduct
fields, type in as you said

Field: field1
Table: DEV_dbo_TblProduct
Sort:
Show: <checked>
Criteria: <> dbo_tblProduct.correspondingfield1
Or:

Once verified that SELECT query is returning
correct records to be updated (and you can see
field values from both fields to check), then
delete the fields from dbo_tblProduct from grid,
change your query to an Update query, and
fill in Update To: row under remaining "DEV" fields in grid.

Field: field1
Table: DEV_dbo_TblProduct
Update To: dbo_tblProduct.correspondingfield1
Criteria: <> dbo_tblProduct.correspondingfield1
Or:

Actually, on many occasions, if fields share
same names, Access will do a pretty good
job filling them in with best guess from the join
when you change to Update query.

good luck,

gary
 

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

Similar Threads


Top