L
Lorenzo
Hello, just for learning purpouses I am trying to figure out how can be
achived the following:
Let's say I have "n" forms in each of them I prompt the user to save the
current record with a button that has the code:
Private Sub cmdSalva_Click()
On Error GoTo Err_cmdSalva_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmdSalva_Click:
Exit Sub
Err_cmdSalva_Click:
MsgBox Err.Description
Resume Exit_cmdSalva_Click
End Sub
All is good but is there a way to put this sub into a module and call it
passing the current form as a parameter? In the code in the form I would
then just have:
Private Sub cmdSalva_Click()
call Save
End Sub
Does this make any sense? Am I getting anywhere? One more question what is
the difference between modules and class modules? If answer is too long a
link to a good resource is also appreciated
Thank you,
Lorenzo
achived the following:
Let's say I have "n" forms in each of them I prompt the user to save the
current record with a button that has the code:
Private Sub cmdSalva_Click()
On Error GoTo Err_cmdSalva_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmdSalva_Click:
Exit Sub
Err_cmdSalva_Click:
MsgBox Err.Description
Resume Exit_cmdSalva_Click
End Sub
All is good but is there a way to put this sub into a module and call it
passing the current form as a parameter? In the code in the form I would
then just have:
Private Sub cmdSalva_Click()
call Save
End Sub
Does this make any sense? Am I getting anywhere? One more question what is
the difference between modules and class modules? If answer is too long a
link to a good resource is also appreciated
Thank you,
Lorenzo