Sendobject macro

  • Thread starter Thread starter lmb0115
  • Start date Start date
L

lmb0115

I would like to add a field from a form to the subject line of a send macro.
The following actions occur before the send macro is run.
Set rsLookUp = Nothing
Set cnCurrent = Nothing
DoCmd.GoToRecord , , acNewRec
DoCmd.OpenQuery "qryAppMaterialsTOPermMaterials", acViewNormal
DoCmd.RunMacro "macSendNewHoldReport"
DoCmd.OpenReport "rptscrapinvestigation", acViewNormal
DoCmd.OpenReport "rptReworkResultsPage", acViewNormal
DoCmd.OpenReport "rptMaterialMovementForm", acViewPreview
DoCmd.OpenReport "rptMaterialMovementForm", acViewNormal
DoCmd.Close acForm, "frmMaterialMovement", acSaveYes
DoCmd.OpenQuery "qryDeltblMaterials", acViewNormal

I am a novice at this but from what I can tell, because the form goes to a
new record on the form(which is blank) it can't see the fldCustomer that I
would like to include in the subject line because the new record is blank.
How can I look at the fldCustomer from the previous record and add that to my
Subject field prior to sending the macro? I currently have the following
information in the subject line of the SendObject macro: ="New Hold" & " " &
[fldCustomer]
 
lmb,

I suppose the easiest solution would be to remove the DoCmd.GoToRecord , ,
acNewRec line from your code, or move it to after the RunMacro. Any reason
why that won't work?
 
Back
Top