Quick n Easy

yessir

Saved By Grace
Local time
Yesterday, 20:57
Joined
May 29, 2003
Messages
349
I have this code for a button, what to I need to add to make it open the form to a new record?

Code:
Private Sub cmd_Open_Add_Client_Form_Click()
On Error GoTo Err_cmd_Open_Add_Client_Form_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmClient"
    DoCmd.OpenForm stDocName, , , stLinkCriteria, , , 2
    
Exit_cmd_Open_Add_Client_Form_Click:
    Exit Sub

Err_cmd_Open_Add_Client_Form_Click:
    MsgBox Err.Description
    Resume Exit_cmd_Open_Add_Client_Form_Click
    
End Sub
 
This should do it.

yessir said:
I have this code for a button, what to I need to add to make it open the form to a new record?

Code:
Private Sub cmd_Open_Add_Client_Form_Click()
On Error GoTo Err_cmd_Open_Add_Client_Form_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmClient"
    DoCmd.OpenForm stDocName, , , stLinkCriteria, , , 2
    docmd.GoToRecord ,,acNewRec
Exit_cmd_Open_Add_Client_Form_Click:
    Exit Sub

Err_cmd_Open_Add_Client_Form_Click:
    MsgBox Err.Description
    Resume Exit_cmd_Open_Add_Client_Form_Click
    
End Sub
 

Users who are viewing this thread

Back
Top Bottom