confirmation messages on append query

  • Thread starter Thread starter June
  • Start date Start date
J

June

I am executing a couple of append queries from a button on
a form but the confirmation messages are confusing to new
users and just basically annoying. I don't want to set
warnings to false and true because then other errors don't
come across. I tried using the CurrentDB.Execute method
but I'm getting a runtime error 3061,"too few parameters
expected 2". My code is simply:

Private Sub CommandSave_Click()

CurrentDb.Execute "qryMfg", dbFailOnError
CurrentDb.Execute "qryComp", dbFailOnError

End Sub
Any ideas or suggestions?
 
Without seeing the SQL of your two queries, my first guess
is that one or both of these queries requires a parameter
that you are not setting. If you could post the SQL, we
might be able to identify the problem.

Dale
 
Yes, they do require parameters but I don't know much VBA
so I don't know how to supply them:
INSERT INTO tblMfg ( SampleID, ParentID, SequenceNumber,
Operator, Carbon, CarbonInv, PercentMetals, SolidsLoading,
System_ID, Generator, DIWaterPH, TempIn, TempOut, )
SELECT tblPostprocessing.SampleID,
tblPostprocessing.ParentID, tblMfg.SequenceNumber,
tblMfg.Operator, tblMfg.Carbon, tblMfg.CarbonInv,
tblMfg.PercentMetals, tblMfg.SolidsLoading,
tblMfg.System_ID, tblMfg.Generator, tblMfg.DIWaterPH,
tblMfg.TempIn, tblMfg.TempOut
FROM tblMfg INNER JOIN tblPostprocessing ON
tblMfg.SampleID = tblPostprocessing.ParentID
WHERE (((tblPostprocessing.SampleID)=[Forms]!
[frmPostProcessing]![SampleID]) AND
((tblPostprocessing.ParentID)=[Forms]![frmPostProcessing]!
[ParentID]));
 
Back
Top