P
Peter Stone
Novice/XP/2003
I open a dialogue box (fdlgPublish) from a subform (fsubProgress) and update
various fields on the subform with the following code:
Private Sub cmdYesPublish_Click()
On Error GoTo Err_cmdYesPublish_Click
Forms!frmText!fsubProgress!cboPublicationStatusID = "3"
Forms!frmText!fsubProgress!txtRecordPublished = Date
Forms!frmText!fsubProgress!txtUpdateCycle = Me!cboPublish.Column(1)
Forms!frmText!fsubProgress!txtNextUpdateDue = Me!cboPublish
Forms!frmText!fsubProgress!cmdPublishUpdate.Caption = "Update"
Forms!frmText.Refresh
DoCmd.Close acForm, Me.Name
Exit_cmdYesPublish_Click:
Exit Sub
Err_cmdYesPublish_Click:
MsgBox Err.Description
Resume Exit_cmdYesPublish_Click
End Sub
So that I can use this dialogue with various forms, I would like to replace
frmText in the coding above with the name of the form that opened the
dialogue box.
From my reading, I believe this can be done using OpenArgs, but I can't find
an example or work out how.
In case it helps, here's the code that opens the dialogue box.
Private Sub cmdPublishUpdate_Click()
On Error GoTo Err_cmdPublishUpdate_Click
Dim stDocName As String
Dim stLinkCriteria As String
If cmdPublishUpdate.Caption = "Publish" Then
'if the record has never been Published
'open the PUBLISH dialogue
stDocName = "fdlgPublish"
Else
'open the UPDATE dialogue
stDocName = "fdlgUpdate"
End If
If bofProgress <> "9" Then
'the record hasn't been EDITED
'open the NOT EDITED message
stDocName = "fmsgNotEdited"
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdPublishUpdate_Click:
Exit Sub
Err_cmdPublishUpdate_Click:
MsgBox Err.Description
Resume Exit_cmdPublishUpdate_Click
End Sub
Thank you
Peter
I open a dialogue box (fdlgPublish) from a subform (fsubProgress) and update
various fields on the subform with the following code:
Private Sub cmdYesPublish_Click()
On Error GoTo Err_cmdYesPublish_Click
Forms!frmText!fsubProgress!cboPublicationStatusID = "3"
Forms!frmText!fsubProgress!txtRecordPublished = Date
Forms!frmText!fsubProgress!txtUpdateCycle = Me!cboPublish.Column(1)
Forms!frmText!fsubProgress!txtNextUpdateDue = Me!cboPublish
Forms!frmText!fsubProgress!cmdPublishUpdate.Caption = "Update"
Forms!frmText.Refresh
DoCmd.Close acForm, Me.Name
Exit_cmdYesPublish_Click:
Exit Sub
Err_cmdYesPublish_Click:
MsgBox Err.Description
Resume Exit_cmdYesPublish_Click
End Sub
So that I can use this dialogue with various forms, I would like to replace
frmText in the coding above with the name of the form that opened the
dialogue box.
From my reading, I believe this can be done using OpenArgs, but I can't find
an example or work out how.
In case it helps, here's the code that opens the dialogue box.
Private Sub cmdPublishUpdate_Click()
On Error GoTo Err_cmdPublishUpdate_Click
Dim stDocName As String
Dim stLinkCriteria As String
If cmdPublishUpdate.Caption = "Publish" Then
'if the record has never been Published
'open the PUBLISH dialogue
stDocName = "fdlgPublish"
Else
'open the UPDATE dialogue
stDocName = "fdlgUpdate"
End If
If bofProgress <> "9" Then
'the record hasn't been EDITED
'open the NOT EDITED message
stDocName = "fmsgNotEdited"
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdPublishUpdate_Click:
Exit Sub
Err_cmdPublishUpdate_Click:
MsgBox Err.Description
Resume Exit_cmdPublishUpdate_Click
End Sub
Thank you
Peter