G
Guest
Hello,
I need help in changing the caption on my form depending on the form's use:
adding a record, updating a record, or deleting a record. My code is as
follows:
'Starts adding a new transfer.
Private Sub cmdNew_Click()
Dim frmTransferDetails As Form_frmTransferDetails
Set frmTransferDetails = Form_frmTransferDetails
'Call the procedure.
Call openForm(frmTransferDetails, "Add Transfer")
End Sub
'Opens the form. Accepts the form name and the form caption as parameters.
Public Sub openForm(frmOpenedForm As Form, strFormCaption As String)
'Dim frmOpenedForm As Form
Dim strFormName As String
strFormName = frmOpenedForm.Name
'Open the form.
DoCmd.openForm strFormName
'Set the form's caption.
frmOpenedForm.Caption = strFormCaption
'Clean up.
'frmOpenedForm = ""
strFormCaption = ""
strFormName = ""
End Sub
I can open the form, but the caption does not change. Any help would be
appreciated. Thanks.
I need help in changing the caption on my form depending on the form's use:
adding a record, updating a record, or deleting a record. My code is as
follows:
'Starts adding a new transfer.
Private Sub cmdNew_Click()
Dim frmTransferDetails As Form_frmTransferDetails
Set frmTransferDetails = Form_frmTransferDetails
'Call the procedure.
Call openForm(frmTransferDetails, "Add Transfer")
End Sub
'Opens the form. Accepts the form name and the form caption as parameters.
Public Sub openForm(frmOpenedForm As Form, strFormCaption As String)
'Dim frmOpenedForm As Form
Dim strFormName As String
strFormName = frmOpenedForm.Name
'Open the form.
DoCmd.openForm strFormName
'Set the form's caption.
frmOpenedForm.Caption = strFormCaption
'Clean up.
'frmOpenedForm = ""
strFormCaption = ""
strFormName = ""
End Sub
I can open the form, but the caption does not change. Any help would be
appreciated. Thanks.