jazminecat23
Programmer
hi all -
I have a form with a subform on it in datasheet view that lists the charges against a person. I need to open the ChargesDetail form based on what record is selected on the subform. This subform is on a tab. I have the button on the tab as well, just below the subform.
When I click the button, it says Microsoft Access cannot find the form ChargesDetail referred to in a macro expression or visual basic code.
Here is my code:
Can anyone help me? basically, when they highlight/select a record on the datasheet subform, and then click the button, I want to open the ChargesDetail form to display the details associated with that charge.
thanks in advance!
I have a form with a subform on it in datasheet view that lists the charges against a person. I need to open the ChargesDetail form based on what record is selected on the subform. This subform is on a tab. I have the button on the tab as well, just below the subform.
When I click the button, it says Microsoft Access cannot find the form ChargesDetail referred to in a macro expression or visual basic code.
Here is my code:
Code:
Private Sub cmdViewChargeDetail_Click()
On Error GoTo Err_cmdViewChargeDetail_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ChargesDetail Form"
stLinkCriteria = "[ChargeID]=" & Forms!ChargesDetail.[ChargeID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdViewChargeDetail_Click:
Exit Sub
Err_cmdViewChargeDetail_Click:
MsgBox Err.Description
Resume Exit_cmdViewChargeDetail_Click
End Sub
Can anyone help me? basically, when they highlight/select a record on the datasheet subform, and then click the button, I want to open the ChargesDetail form to display the details associated with that charge.
thanks in advance!