Below is an simple example of vb associated with a command button (Print)
Option Compare Database
Private Sub PrintRecord_Click()
On Error GoTo Err_PrintRecord_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection
Exit_PrintRecord_Click:
Exit Sub
Err_PrintRecord_Click:
MsgBox Err.Description
Resume Exit_PrintRecord_Click
End Sub
**********************************************
And this is simple code I placed into a module to create a new record.
Option Compare Database
Function NewRecord()
DoCmd.GoToRecord , , acNewRec
End Function
**********************************************
Problem……Where do I place: Call NewRecord. Everywhere I attempt to put it in the code – it either won’t work or I get an error message saying : Compile Error / Invalid use of Property
What am I doing wrong?
Vince
Option Compare Database
Private Sub PrintRecord_Click()
On Error GoTo Err_PrintRecord_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection
Exit_PrintRecord_Click:
Exit Sub
Err_PrintRecord_Click:
MsgBox Err.Description
Resume Exit_PrintRecord_Click
End Sub
**********************************************
And this is simple code I placed into a module to create a new record.
Option Compare Database
Function NewRecord()
DoCmd.GoToRecord , , acNewRec
End Function
**********************************************
Problem……Where do I place: Call NewRecord. Everywhere I attempt to put it in the code – it either won’t work or I get an error message saying : Compile Error / Invalid use of Property
What am I doing wrong?
Vince