Hi,
I'm new to Access and am hoping that somebody can help me.
I have an unbound form that contains a text field and a button and an unbound subform. Select criteria is entered into the text field and when the button is pressed the on_click event sets the recordsource property of the subform which then displays the selected data. This bit is straight from the MS Access help pages and works fine.
The problem that I have is that I want to add another button to the master form that opens a form but passes the unique id from from the highlighted record in the subform using open_args. The code behind the button is :
When the button is pressed the message displayed is:
Can't find the field Me!QueryPropertySubform!PropertyId.Value
It complains that the field is either misspelt (it isn't!), renamed or deleted.
I have tried lots of different ways to get this to work but to no avail. All help appreciated.
I'm new to Access and am hoping that somebody can help me.
I have an unbound form that contains a text field and a button and an unbound subform. Select criteria is entered into the text field and when the button is pressed the on_click event sets the recordsource property of the subform which then displays the selected data. This bit is straight from the MS Access help pages and works fine.
The problem that I have is that I want to add another button to the master form that opens a form but passes the unique id from from the highlighted record in the subform using open_args. The code behind the button is :
Code:
Private Sub QueryPropertyMatchRun_Click()
On Error GoTo Err_QueryPropertyMatchRun_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "MatchProperty"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , [Me!QueryPropertySubform!PropertyId.Value]
Exit_QueryPropertyMatchRun_Click:
Exit Sub
Err_QueryPropertyMatchRun_Click:
MsgBox Err.Description
Resume Exit_QueryPropertyMatchRun_Click
End Sub
When the button is pressed the message displayed is:
Can't find the field Me!QueryPropertySubform!PropertyId.Value
It complains that the field is either misspelt (it isn't!), renamed or deleted.
I have tried lots of different ways to get this to work but to no avail. All help appreciated.