Open form to New Record

Vav

Registered User.
Local time
Today, 05:33
Joined
Aug 29, 2002
Messages
36
Hello,

I have created a "Pop Up" form that asks the user to make a selection.

"Open New Form", or "Edit or Update existing Form"

If the user requests "Open New Form" I want the intended form to open up with a brand new (blank) record.

Does anyone know how to do this.

Thanks
 
in your code behind the button, you need to replace this:

DoCmd.openForm stDocName, , , stLinkCriteria
with this:
DoCmd.openForm stDocName, , , acFormAdd

i'm definitely not one of the experts here, but with everyone's help, i'm making progress. ruralguy helped me w/a similar issue - maybe you can use it too. in my case i'm saving contractor info & adding a permit for that contractor in the same button. here's my code...hope this helps...;)

Private Sub cmdAddPermit_Click()
On Error GoTo Err_cmdAddPermit_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmPermitOrders"

If Me.Dirty Then
'-- Save the current record
DoCmd.RunCommand acCmdSaveRecord
End If

DoCmd.openForm stDocName, , , acFormAdd

Exit_cmdAddPermit_Click:
Exit Sub

Err_cmdAddPermit_Click:
MsgBox "Error No: " & Err.Number & vbCr & _
"Description: " & Err.Description
Resume Exit_cmdAddPermit_Click

End Sub
 

Users who are viewing this thread

Back
Top Bottom