View Single Post
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
rsw
 
Posts: n/a
Default Merge with Access Query

Here is the SQL for the query. Thanks for looking.


SELECT dbo_AltLoss.[Claim Number], dbo_Register.[Policy Number],
dbo_Register.[Date Entered], dbo_Register.Initials, dbo_Register.[Date
of Loss], dbo_Register.[Cause of Loss], dbo_Register.[Status of Claim],
dbo_Register.[Closed Date], dbo_Register.[Insured Name],
dbo_Register.[Insured Address], dbo_Register.[Insured City],
dbo_Register.[Insured State], dbo_Register.[Insured Zip],
dbo_Register.[Insured Phone], dbo_Register.[Insured Phone2],
dbo_Register.Location, dbo_Register.[Claimant First Name],
dbo_Register.[Claimant Last Name], dbo_Register.[Claimant Address],
dbo_Register.[Claimant City], dbo_Register.[Claimant State],
dbo_Register.[Claimant Zip], dbo_Register.[Claimant Phone],
dbo_Register.[Claimant Phone2], dbo_Register.Injury,
dbo_Register.Label, dbo_Register.[Date Claim Rcvd], dbo_Register.[Date
Report Rcvd], dbo_Register.[Date Report Not Approved],
dbo_AltLoss.[Producer Name], dbo_AltLoss.[Producer Address],
dbo_AltLoss.[Producer City], dbo_AltLoss.[Producer State],
dbo_AltLoss.[Producer Zip], dbo_AltLoss.[Producer Phone],
dbo_AltLoss.[Producer Code], dbo_AltLoss.EffDate, dbo_AltLoss.ExpDate,
dbo_AltLoss.[Contact Name], dbo_AltLoss.[Contact Address],
dbo_AltLoss.[Contact CSZ], dbo_AltLoss.[Contact Phone1],
dbo_AltLoss.[Contact Phone2], dbo_AltLoss.Authority,
dbo_AltLoss.Description, dbo_AltLoss.[Claimant DOB],
dbo_AltLoss.[Claimant SS], FormatCurrency([PersAdvInj],0) AS
[Calc-PersAdvInj], FormatCurrency([PremiseLiab],0) AS
[Calc-PremiseLiab], FormatCurrency([Medical Expense],0) AS
[Calc-Medical Expense], FormatCurrency([Deductible],0) AS
[Calc-Deductible], dbo_AltLoss.Type, dbo_AltLoss.Injury,
dbo_AltLoss.Injury1, dbo_AltLoss.[Witness Name], dbo_AltLoss.[Witness
Address], dbo_AltLoss.[Witness CSZ], dbo_AltLoss.[Witness Phone],
dbo_AltLoss.[Additional Information], dbo_AltLoss.[Reported By],
dbo_AltLoss.[Reported To], dbo_AltLoss.[DateTime Received],
FormatCurrency([OTC Deductible],0) AS [Calc-OTC Deductible],
FormatCurrency([Coll Deductible],0) AS [Calc-Coll Deductible],
dbo_AltLoss.[Other Coverage], dbo_AltLoss.[Insured Vehicle],
dbo_AltLoss.[Insured Driver], dbo_AltLoss.[Insured Phone],
dbo_AltLoss.Damage, dbo_AltLoss.LocationVeh, dbo_AltLoss.[Claimant
Vehicle], dbo_AltLoss.LocationVeh1, dbo_AltLoss.Damage1,
dbo_AltLoss.[Insurance Carrier], dbo_AltLoss.[Injured Name],
dbo_AltLoss.[Injured Name1], dbo_AltLoss.[Injured Address],
dbo_AltLoss.[Injured Address1], dbo_AltLoss.[Injured CSZ],
dbo_AltLoss.[Injured CSZ1], dbo_AltLoss.[Injured Phone],
dbo_AltLoss.[Injured Phone1], dbo_AltLoss.Veh1, dbo_AltLoss.Veh2,
dbo_AltLoss.NoInjuries, dbo_AltLoss.KindofLoss, dbo_AltLoss.[Amount of
Loss], dbo_AltLoss.Mortgagee, dbo_AltLoss.[Mortagagee Name],
dbo_AltLoss.Item5, dbo_AltLoss.Item1, dbo_AltLoss.Item2,
dbo_AltLoss.Item3, dbo_AltLoss.Item4, dbo_AltLoss.Subject1,
dbo_AltLoss.Subject2, dbo_AltLoss.Subject3, dbo_AltLoss.Subject4,
dbo_AltLoss.Subject5, FormatCurrency([Amount1],0) AS [Calc-Amount1],
FormatCurrency([Amount2],0) AS [Calc-Amount2],
FormatCurrency([Amount3],0) AS [Calc-Amount3],
FormatCurrency([Amount4],0) AS [Calc-Amount4],
FormatCurrency([Amount5],0) AS [Calc-Amount5], FormatCurrency([Ded1],0)
AS [Calc-Ded1], FormatCurrency([Ded2],0) AS [Calc-Ded2],
FormatCurrency([Ded3],0) AS [Calc-Ded3], FormatCurrency([Ded4],0) AS
[Calc-Ded4], FormatCurrency([Ded5],0) AS [Calc-Ded5], dbo_AltLoss.RC1,
dbo_AltLoss.RC2, dbo_AltLoss.RC3, dbo_AltLoss.RC4, dbo_AltLoss.RC5,
dbo_AltLoss.PropDes1, dbo_AltLoss.PropDes2, dbo_AltLoss.PropDes3,
dbo_AltLoss.PropDes4, dbo_AltLoss.PropDes5, dbo_AltLoss.Reinsurance1,
dbo_AltLoss.Explain, dbo_AltLoss.ReportType,
FormatCurrency([Bodilyinjury],0) AS [Calc-Bodilyinjury],
FormatCurrency([Bodilyinjury1],0) AS [Calc-Bodilyinjury1],
FormatCurrency([PropDam],0) AS [Calc-PropDam],
dbo_AltLoss.Reinsurance2, dbo_AltLoss.Reinsurance3,
dbo_AltLoss.Reinsurance4, dbo_AltLoss.Reinsurance5,
dbo_AltLoss.Reinsurance6,
IIf([ReportType]=1,"TELEPHONE",IIf([ReportType]=2,"WRITE-UP","")) AS
[Calc-ReportTypetext], IIf([Veh1]=1,"INSURED
VEHICLE",IIf([Veh1]=2,"CLAIMANT VEHICLE","")) AS [Calc-Veh1text],
IIf([Veh2]=1,"INSURED VEHICLE",IIf([Veh2]=2,"CLAIMANT VEHICLE","")) AS
[Calc-Veh2text], dbo_ZipCodes.CITY, dbo_ZipCodes.STATE,
IIf([NoInjuries]=0,"YES",IIf([NoInjuries]=-1,"NO"," ")) AS
CalcNoInjuriestext, IIf([Type]=1,"PD",IIf([Type]=2,"BI"," ")) AS
CalcTypeOptionstext, dbo_AltLoss.[Witness Name2], dbo_AltLoss.[Witness
Address2], dbo_AltLoss.[Witness CSZ2], dbo_AltLoss.[Witness Phone2],
dbo_AltLoss.[Witness Name3], dbo_AltLoss.[Witness Address3],
dbo_AltLoss.[Witness CSZ3], dbo_AltLoss.[Witness Phone3],
IIf([kindofloss]=1,"FIRE",IIf([kindofloss]=2,"THEFT",IIf([kindofloss]=3,"LIGHTNING",IIf([kindofloss]=4,"HAIL",IIf([kindofloss]=5,"FLOOD",IIf([kindofloss]=6,"WIND",IIf([kindofloss]=7,"OTHER","")))))))
AS [Calc-kindoflosstext],
IIf([Mortgagee]=1,"YES",IIf([Mortgagee]=2,"NO","")) AS
[Calc-MortgageeText],
IIf([subject1]=1,"BLDG",IIf([subject1]=2,"CNTS",IIf([subject1]=3,"BLKT","")))
AS [Calc-Sub1],
IIf([subject2]=1,"BLDG",IIf([subject2]=2,"CNTS",IIf([subject2]=3,"BLKT","")))
AS [Calc-Sub2],
IIf([subject3]=1,"BLDG",IIf([subject3]=2,"CNTS",IIf([subject3]=3,"BLKT","")))
AS [Calc-Sub3],
IIf([subject4]=1,"BLDG",IIf([subject4]=2,"CNTS",IIf([subject4]=3,"BLKT","")))
AS [Calc-Sub4],
IIf([subject5]=1,"BLDG",IIf([subject5]=2,"CNTS",IIf([subject5]=3,"BLKT","")))
AS [Calc-Sub5], dbo_Register.[CAT Number], dbo_AltLoss.VIN
FROM (dbo_AltLoss INNER JOIN dbo_Register ON dbo_AltLoss.[Claim Number]
= dbo_Register.[Claim Number]) INNER JOIN dbo_ZipCodes ON
dbo_AltLoss.[Producer Zip] = dbo_ZipCodes.ZIP
WHERE (((dbo_AltLoss.[Claim Number])=[Forms]![Atl Loss]![Claim
Number]));

Peter Jamieson wrote:
Can you post the SQL code for the query here please?

Peter Jamieson

"rsw" wrote in message
oups.com...
I hope that I can explain this correctly.
I have an Access XP Database the back end is in SQL.
On Form 1 we have users enter claim information including claim number
and then click a "Loss Notice" button that opens Form 2. There we have

them enter the claim number again (same number). They fill in the
additional information needed for the claim. Then we have them click
on a button that opens a Word Merge file. In the query we use for that

form we tell it to use the data that is on Form 2 in the claim number
field. Therefore, when it pulls into word it should just pull in the
info for the claim number that we are on.

The users have reported that occasionally (not always) they will get an

Enter Parameter Value box asking for the claim number from the form.
They type the claim number and all is fine.


In all the testing I have done I have NEVER got the Parameter box.
Does anyone have an idea as to why they are getting this box
occasionally? I also asked if they saw a pattern but they have not.

I am told that Word does not handle merge's with queries very well - is
this the case? Do you have any idea how I can get the parameter box to
not come up when connecting to Access.


ANY help would be great!