Ok basically I wont bore you with the reason I need this as it even baffles myself and it would be a very long winded explanation hehe.
Basically, what I want to do is save a variable from a selected field when you click a button that is within a (table) subform and then call on that field (Project ID) to FindRecord (Project ID) within another form after I have changed the control source of the subform that will contain that form. I need to save as a variable for a reason but I wont bore you with that like I said. I can't just use findrecord from that field location
This is the code that I am using at the moment:
As you can see, there is also a simple error message that is displayed when there are no records within the table/subform.
Thanks alot for any help
scott
Basically, what I want to do is save a variable from a selected field when you click a button that is within a (table) subform and then call on that field (Project ID) to FindRecord (Project ID) within another form after I have changed the control source of the subform that will contain that form. I need to save as a variable for a reason but I wont bore you with that like I said. I can't just use findrecord from that field location

This is the code that I am using at the moment:
Code:
Private Sub open_record_button_in_proposed_tab_Click()
Dim x As String
On Error GoTo Err_openrecord_Click
If Forms![frm_main]![Sub_Main]![proposed_subform].Form.RecordsetClone.RecordCount = 0 Then
MsgBox "There are no proposed projects entered for this Client."
Else
x = "Forms![frm_main]![Sub_Main]![frm_projects].Form![Project ID]"
Forms("Frm_Main").Sub_Main.SourceObject = "frm_projects"
DoCmd.FindRecord x
DoCmd.FindRecord Forms![frm_main]![Sub_Main]![active_subform].Form![Project ID]
End If
Exit_openrecord_Click:
Exit Sub
Err_openrecord_Click:
MsgBox Err.Description
Resume Exit_openrecord_Click
End Sub
As you can see, there is also a simple error message that is displayed when there are no records within the table/subform.
Thanks alot for any help
scott