I am having some trouble with the listed code, but I'm not sure if the problem is within the code or the form:
Code:
Private Sub cmdClose_Click()
Dim Msg, Style, Title, Response, MyString
If [Amt_EarlyEFT] = 0 Then
Msg = "Do you want to submit with a 0.00 amount?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Title = "Empty Amount"
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
DoCmd.RunMacro ("manual input form - CLOSE")
Else ' User chose No.
DoCmd.GoToControl ("Amt_EarlyEFT")
End If
Else: DoCmd.RunMacro ("manual input form - CLOSE")
End If
End Sub
This code runs as expected, but it runs prior to the record on the form being added to the table. The referenced macro runs several append queries and then clears a temp table, so if I run the process six times in a row, the first five entries move perfectly and the last one gets stranged in the temp table. I'm new to programming and most of this code is already borrowed, so I have no idea if I just have things in the wrong order or if I need additional code to add that last record from the form to the table before the macro fires. Any help would be greatly appreciated!