G
Guest
Upfront disclaimer: I'm an Access newbie, though experienced in other
programming environments/languages.
I'm trying to fix a database for a friend, over the weekend, so any quick
answers would be hugely appreciated.
When I invoke a certain form directly from 'Forms' it works fine.
When I invoke it through a button on another form, I get 'The OpenForm
action was cancelled.'
When I try to debug the latter by interrogating DataErr I find that it's
null / blank.
The argument that I'm passing has the values in it that I expect, @ runtime.
Code follows:
Private Sub Pro_Bono_Button3_Click()
On Error GoTo Err_Pro_Bono_Button3_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Pro Bono Attorney"
stLinkCriteria = "[DB CLIENT #]=" & "'" & Me![DB CLIENT #] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Pro_Bono_Button3_Click:
Exit Sub
Err_Pro_Bono_Button3_Click:
MsgBox "DB Client # = " & Me![DB CLIENT #] & "'"
MsgBox "Standard Doc Name = " & stDocName & "'"
MsgBox "Standard Link Criteria = " & stLinkCriteria & "'"
MsgBox "Error Code = " & DataErr & "'"
MsgBox Err.Description
Resume Exit_Pro_Bono_Button3_Click
End Sub
I tried compacting the database, per a suggestion to someone else receiving
the same err message but a 2501 err code, to no avail. Thoughts / suggestions?
Thank you!
Tom Wheeler
programming environments/languages.
I'm trying to fix a database for a friend, over the weekend, so any quick
answers would be hugely appreciated.
When I invoke a certain form directly from 'Forms' it works fine.
When I invoke it through a button on another form, I get 'The OpenForm
action was cancelled.'
When I try to debug the latter by interrogating DataErr I find that it's
null / blank.
The argument that I'm passing has the values in it that I expect, @ runtime.
Code follows:
Private Sub Pro_Bono_Button3_Click()
On Error GoTo Err_Pro_Bono_Button3_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Pro Bono Attorney"
stLinkCriteria = "[DB CLIENT #]=" & "'" & Me![DB CLIENT #] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Pro_Bono_Button3_Click:
Exit Sub
Err_Pro_Bono_Button3_Click:
MsgBox "DB Client # = " & Me![DB CLIENT #] & "'"
MsgBox "Standard Doc Name = " & stDocName & "'"
MsgBox "Standard Link Criteria = " & stLinkCriteria & "'"
MsgBox "Error Code = " & DataErr & "'"
MsgBox Err.Description
Resume Exit_Pro_Bono_Button3_Click
End Sub
I tried compacting the database, per a suggestion to someone else receiving
the same err message but a 2501 err code, to no avail. Thoughts / suggestions?
Thank you!
Tom Wheeler