P
Pip''''n
I receive the error message "You cancelled the Previous Operation". Most
times the code works but it's still frustrating for my users. Can you tell me
what i'm doing wrong?
Any assistance is greatly appreciated.
Description:
The user selects a record from a listbox.
Clicks an "open" button.
Form called TCA is opened to record to corresponds to the item selected in
the listbox.
Code:
Private Sub New_OpenTCA_Click()
On Error GoTo Err_New_OpenTCA_Click
Dim stDocName As String
Dim stLinkCriteria As String
' user selects a record from a listbox (notify if no record selected)
If Me.New_TCAUnit <> "" And IsNull(New_TCAUnit) = False Then
stDocName = "TCA"
stLinkCriteria = "[TCANo]=" & Me![New_TCAUnit]
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
' disallow scrolling of records
Form_TCA.AllowAdditions = False
Else 'no tca selected
MsgBox ("Please select a TCA to view before continuing.")
End If
' ensure that continue with sale button is visible
Form_TCA.ContinueWSale.Visible = True
Exit_New_OpenTCA_Click:
Exit Sub
Err_New_OpenTCA_Click:
MsgBox Err.Description
Resume Exit_New_OpenTCA_Click
End Sub
Thanks in advance,
Pip''n
times the code works but it's still frustrating for my users. Can you tell me
what i'm doing wrong?
Any assistance is greatly appreciated.
Description:
The user selects a record from a listbox.
Clicks an "open" button.
Form called TCA is opened to record to corresponds to the item selected in
the listbox.
Code:
Private Sub New_OpenTCA_Click()
On Error GoTo Err_New_OpenTCA_Click
Dim stDocName As String
Dim stLinkCriteria As String
' user selects a record from a listbox (notify if no record selected)
If Me.New_TCAUnit <> "" And IsNull(New_TCAUnit) = False Then
stDocName = "TCA"
stLinkCriteria = "[TCANo]=" & Me![New_TCAUnit]
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
' disallow scrolling of records
Form_TCA.AllowAdditions = False
Else 'no tca selected
MsgBox ("Please select a TCA to view before continuing.")
End If
' ensure that continue with sale button is visible
Form_TCA.ContinueWSale.Visible = True
Exit_New_OpenTCA_Click:
Exit Sub
Err_New_OpenTCA_Click:
MsgBox Err.Description
Resume Exit_New_OpenTCA_Click
End Sub
Thanks in advance,
Pip''n