open form using subform Record

stungray99

New member
Local time
Today, 06:01
Joined
May 3, 2011
Messages
1
I have a parentForm and a child subForm. There are several hundred records in the subForm dataset. If I select a subForm Record, I wish to use a control (button) on parentForm, to open a third form at the recordset of the selected record in the subForm.

Can this be achieved, I've read about how focus is lost from the subForm when the button on parentForm is 'clicked'. Also can a 'button' be created on the subForm?
 
You can use this technique:

http://www.baldyweb.com/wherecondition.htm

Access should remember the last record in the subform with focus, but I'd use a button on the subform, or the double click event of a textbox. Buttons don't show in datasheet view, but they do in continuous view.
 
Can I tag onto this thread and ask for basically the same question? I am not getting a solution from the answer provided here.

It was said that a button on the subform can be used. Problem is, I see no way to display the form in any way other than datasheet. Even if I define the subform to be default continuous and datasheet NO, once it is displayed on my form, it is displayed as datasheet. I can see no property to change this. Therefore the button on the subform, which I had thought of and tried, does not work for me.

So, I have to go back to the original question. How do I get the value of 1 field of 1 record in a subform, and make that value available to the parent?

If the forms are named as follow:
"Parent" - parent form
"SubControl" - subform control
"SubForm" - Actual name of form placed into the subform control
"MyField" - the field I want to get the data from.

How do I reference this field? I want to highlight one record, then click something somewhere, and have an action performed based on the data found in that highlighted record.

Thank you.
 
As mentioned, you can use the double click event of a textbox ("double click on ID for details"). Presuming the code is in the subform, simply referring to the control that contains the value will work:

Me.ControlName

Here's a good reference on the different syntax requirements:

http://www.mvps.org/access/forms/frm0031.htm

I can't imagine why the subform is being forced into datasheet view, though I never use it. Is the main form in datasheet view?
 

Users who are viewing this thread

Back
Top Bottom