J
Jan Il
Hi all - Access 2002 XP, W2K SP4
I have a form for which I have a unbound combo box with a command button
with the following code, that opens a Record form with the repective data
selected in the combo box.
Private Sub cmdCardAcctNum_Click()
On Error GoTo Err_cmdCardAcctNum_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmCreditCardReg"
stLinkCriteria = "[AcctNo]=" & "'" & Me![cmbCardAcctNum] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdCardAcctNum_Click:
Exit Sub
Err_cmdCardAcctNum_Click:
MsgBox Err.Description
Resume Exit_cmdCardAcctNum_Click
End Sub
When I make a selection from the combo box and then click the command
button, I am getting an error message that says: "OpenForm action was
cancelled". No reason why, or any other information in the error message.
This happens for all 6 of the command buttons on the form. One of the
command buttons just opens the Record form with all the records, so there's
no combo box or other action control that is used in conjunction with it. I
have used this process many times before, and never gotten any error
message. I have checked all the control and form names and they are correct
as written as far as I can see.
I have tried to look this error up and so far have not found any explanation
for it. I would truly appreciate it if someone could explain what this type
of message means so that I will have a better idea of how to troubleshoot
the problem.
Jan
Smiles are meant to be shared,
that's why they're so contagious.
I have a form for which I have a unbound combo box with a command button
with the following code, that opens a Record form with the repective data
selected in the combo box.
Private Sub cmdCardAcctNum_Click()
On Error GoTo Err_cmdCardAcctNum_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmCreditCardReg"
stLinkCriteria = "[AcctNo]=" & "'" & Me![cmbCardAcctNum] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdCardAcctNum_Click:
Exit Sub
Err_cmdCardAcctNum_Click:
MsgBox Err.Description
Resume Exit_cmdCardAcctNum_Click
End Sub
When I make a selection from the combo box and then click the command
button, I am getting an error message that says: "OpenForm action was
cancelled". No reason why, or any other information in the error message.
This happens for all 6 of the command buttons on the form. One of the
command buttons just opens the Record form with all the records, so there's
no combo box or other action control that is used in conjunction with it. I
have used this process many times before, and never gotten any error
message. I have checked all the control and form names and they are correct
as written as far as I can see.
I have tried to look this error up and so far have not found any explanation
for it. I would truly appreciate it if someone could explain what this type
of message means so that I will have a better idea of how to troubleshoot
the problem.
Jan
Smiles are meant to be shared,
that's why they're so contagious.