Posted on 2011-09-18
I have a button on an unbound form with the following code attached
Private Sub btnEmailCC_Click()
On Error GoTo Err_btnEmailCC_Click
Dim strWhereCriteria As String
strWhereCriteria = "shipnote = Forms!frmXLNote!txtNoteNum"
Dim Aresponse As Integer
Aresponse = MsgBox("Was the pallet count correct?", vbQuestion + vbYesNo, "Pallets Correct ?")
If Aresponse = vbYes Then
DoCmd.SendObject acSendReport, "rptSpecNote2", acFormatPDF, _
"firstname.lastname@example.org;email@example.com", , , "Despatch Note", _
"Please see attached PDF re latest Despatch Note."
btnUpDate.Visible = True
btnEmailCC.Visible = False
MsgBox "You must now Update the Call-Off!", vbCritical, "Update!"
If Aresponse = vbNo Then
DoCmd.OpenForm "frmEditCCnote", , , strWhereCriteria
MsgBox Err.Description, vbOKOnly, "An Error has occured, please inform S.Byrom"
When the user clicks "No" to edit the items shipped it opens a split form which is bound to a table (tblStordProds) and has a button on it to add a record if needed. The code attached to the button is;
Private Sub btnAdd_Click()
On Error GoTo Err_btnClose_Click
DoCmd.GoToRecord , , acNewRec
MsgBox "You must now change the added Product" & vbCrLf & _
"to the product you missed originally." & vbCrLf & _
"Use the drop-down arrow to change it." & vbCrLf & vbCrLf & _
"DO NOT FORGET TO ADJUST THE QUANTITY!", vbCritical, "IMPORTANT"
MsgBox Err.Description, vbOKOnly, "An Error has occured, Please inform S.Byrom"
However, when I add a record using the button on the second form and then close it. It does not save the record just added.
Is it because the records are filtered in the open argument from the previous form?
If so, how can I get around this? If not, why will it not add a record to the table?
Thanks as always for your time.