I'll try to make this brief for those kind souls that will help me! I'm not an elegant programmer, so please forgive the horrible syntax/grammar/etc.....
2. Scenario: I have an order form for a service. If the service isn't completed satisfactorily, the customer can resubmit the order by pressing a 'Resubmit' button (code below), which SHOULD 1. create a copy of the current service request, 2. clear & change certain fields on the form, and 3. send an email to the individual who has to take action on the request.
3. Problem: Copying the record as a standalone set of code works fine! Sending the email as a standalone code works fine, BUT when I add in the code to set the hoursbilled to zero, and copy the variable 'groupid' to the deliverable group, the entire subroutine doesn't function when the button is pressed on the form. No new record, no email, nuthin! I'm sure this is a no-brainer to most, but its got me stumped! How do I set these fields to the required values? HELP!
)
Private Sub cmdResub_Click()
Dim groupid As Double
groupid = Me.[DeliverableID] 'copy current record ID for new record group
DoCmd.DoMenuItem acFormBar, acEditMenu, acSelectRecord, , acMenuVer70 'select current reocrd
DoCmd.DoMenuItem acFormBar, acEditMenu, acCopy, , acMenuVer70 'copy current record
DoCmd.GoToRecord , , acNewRec ' create new record
DoCmd.DoMenuItem acFormBar, acEditMenu, 3, , acMenuVer70 'past data into new record
DoCmd.GoToRecord , , acLast 'ensure the new record is current
Me.HoursBilled = 0
Me.DeliverableIDGroup = groupid
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord
Dim OPRAddress, OPRAddress2, OPRAddress3 As String
OPRAddress = ' recipient
DoCmd.SendObject acSendReport, "rpt_snapshot_mailout", etc..
End Sub
Thanks for your consideration of this problem that has cost me close to 3 hours of my life so far trying to solve!
2. Scenario: I have an order form for a service. If the service isn't completed satisfactorily, the customer can resubmit the order by pressing a 'Resubmit' button (code below), which SHOULD 1. create a copy of the current service request, 2. clear & change certain fields on the form, and 3. send an email to the individual who has to take action on the request.
3. Problem: Copying the record as a standalone set of code works fine! Sending the email as a standalone code works fine, BUT when I add in the code to set the hoursbilled to zero, and copy the variable 'groupid' to the deliverable group, the entire subroutine doesn't function when the button is pressed on the form. No new record, no email, nuthin! I'm sure this is a no-brainer to most, but its got me stumped! How do I set these fields to the required values? HELP!
Private Sub cmdResub_Click()
Dim groupid As Double
groupid = Me.[DeliverableID] 'copy current record ID for new record group
DoCmd.DoMenuItem acFormBar, acEditMenu, acSelectRecord, , acMenuVer70 'select current reocrd
DoCmd.DoMenuItem acFormBar, acEditMenu, acCopy, , acMenuVer70 'copy current record
DoCmd.GoToRecord , , acNewRec ' create new record
DoCmd.DoMenuItem acFormBar, acEditMenu, 3, , acMenuVer70 'past data into new record
DoCmd.GoToRecord , , acLast 'ensure the new record is current
Me.HoursBilled = 0
Me.DeliverableIDGroup = groupid
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord
Dim OPRAddress, OPRAddress2, OPRAddress3 As String
OPRAddress = ' recipient
DoCmd.SendObject acSendReport, "rpt_snapshot_mailout", etc..
End Sub
Thanks for your consideration of this problem that has cost me close to 3 hours of my life so far trying to solve!