Hi Lynn.
Thanks for trying to help. Here is a more detailed explanation.
I have a table, tblNew with images of the three records that I want to
create, minus the form-specific information (amounts are zero and dates are
blank). The record types are in these three records. I have a macro set up
that runs the steps as follows.
1. This is the SQL for the first query. It just takes my blank records and
copies them to a new table so that the original “clean†records are not
changed.
SELECT [tblNew].* INTO [tblWorkfields] FROM [tblNew];
2. The second query pulls the information from the form and populates the
work records.
UPDATE [tblWorkfields] SET
[tblWorkfields].[FK-PH-ID] = Forms!frmPH!frmHist![FK-PH-ID],
[tblWorkfields].[Policy Number] = Forms!frmPH!frmHist![Policy Number],
[tblWorkfields].[Named Insured] = Forms!frmPH.frmHist![Named Insured],
[tblWorkfields].[Effective Date] = Forms!frmPH.frmHist![Effective Date],
[tblWorkfields].Carrier = Forms!frmPH.frmHist!Carrier,
[tblWorkfields].[MoDocs Option] = Forms!frmPH.frmHist![MoDocs Option],
[tblWorkfields].[Member Policy Number] = Forms!frmPH.frmHist![Member Policy
Number],
[tblWorkfields].[Expiration Date] = Forms!frmPH.frmHist![Expiration Date],
[tblWorkfields].[Limits of Liability] = Forms!frmPH.frmHist![Limits of
Liability],
[tblWorkfields].[Annual Premium] = Forms!frmPH!frmHist![Annual Premium],
[tblWorkfields].[Comm Rate] = Forms!frmPH!frmHist![Comm Rate],
[tblWorkfields].[Last Updated] = Now();
3. I open the tblWorkfields.
4. I Select All Records from the tblWorkfields.
5. I copy all of the selected records.
6. I open the target table, tblHistory.
7. I Paste/Append the copied records from tblWorkfields to tblHistory.
The problem is that data that should end up in one field, ends up in
another…Expiration Date ends up in, for example, Policy Number.
I have a multi-user environment, so I have no guarantee that another user
hasn’t pulled up the table and moved fields around, perhaps in preparation
for a sort. So, the field order in tblNew, which is my new “clean†records
may or may not be the same as the field order in tblHistory, which is what
creates my problem. Is there any way to be field specific in my append?
Thanks for your help.
--
Karen Miller
Kansas City, MO
Lynn Trapp said:
Karen,
As far as I can tell the only way to accomplish what you want, if I
understand your description correctly, is to use a series of append queries
to add the new records. I don't quite understand what you mean by the fields
being in the correct order, however. Can you describe what you mean,
possibly by posting some sample data and the SQL for the append queries you
are using?
Thanks,