If Statement Question

Jferrigno

New member
Local time
Today, 12:45
Joined
Jul 8, 2010
Messages
1
hello to all, I am looking for some help creating some IF Statements.

I have two tables. one is a master key that has four fields: NAME, ID, ADM DATE, DISCH DATE
The other table is from a database that I have with the same fields.
This db table has records where the NAME is populated but the fields: ID, ADM DATE and DISCH DATE are not populated.
It also has the reverse situation where the ID is populated but the fields: NAME, ADM DATE and DISCH DATE are not populated.

I am a bit of a novice with Access but I'm learning. I understand that by matching the ID to ID and NAME to NAME fields from the db table to the Key table I can update the missing records but I don't know the format for the IF Statement.

I would appreciate any help I can get on this.
thank you,
J
 
Its not that simple. It's really a question of synchronizing the two tables and cycling through them. I would suggest getting a book to learn how to do that.

Based on Statsman's subsequent comment, let me clarify that I am referring to the use of a DAO or ADO recordset, not SQL to accomplish your objective.
 
Last edited:
You are going to have a problem doing this via a query as the fields in both tables have the same name. You will get continuous error messages that the query can"t distinguish between the field to be copied and the field to be copied to.

You could of course change the names in one table. This would allow you to run a query which copies from one table to the other. You can change the names back after the update.

A better way might be to create a new table with the same fields but with different names and then copy to the new table from both old tables one at a time.
 

Users who are viewing this thread

Back
Top Bottom