Hey man sorry I have been busy these last few days. With out actually knowing your database I cant give a direct answer because any answer might not directly work. But I can try and point you in the right direction. I already have actually but lets try and put things together in one cohesive post.
lets break down what your trying to do and see if we cant come up with a solution.
you want to select a record in a subform and then push a button to have another form open to that record so you can edit it.
1. you will need the original form, a subform (with your record on it) and an edit button to open yet another third form for record editing.
I feel by your description you already have all 3 forms built you just need to know how to get your button to work. (I am still pretty new so I dont know the direct answer but I know enough to give it a shot at a description.)
The first think we need to know how to do is open a form with vba code.
Code:
Private Sub EditButton_Click() DoCmd.OpenForm "myFormName", acNormal, ,(*Where Condition Goes Here)* , , acDialog
End Sub
That is code I have used before.
you were confused about the where condition so lets break that down a little bit further.
your where condition needs to specify what record you want to edit. So what does that mean.
it means your button needs to get a reference to the sub form that has the focused record and it needs to open the third form filtered to that record.
next you need to ask yourself how to access your subform through code.
to do this you need to qualify the reference. which I posted an example here.
[Forms]![myFormName]![myTargetField]
the first part to this statement is [Forms]!
This is stating you want to access a form from the forms definitions.
![myFormName]
is the name of your subform.
![myTargetField]
is the record that you have selected.
so try and play around with the Intellisense when you write your code and see what pops up.
I would assume you are going to want a statement similar to this
Code:
Private Sub EditButton_Click()
DoCmd.OpenForm "myFormName", acNormal, ,[Forms]![mySubForm]![selected] , , acDialog
End Sub
it could also be
Code:
Private Sub EditButton_Click()
DoCmd.OpenForm "myFormName", acNormal, ,[Forms]![mySubForm].selected , , acDialog
End Sub
I always get confused on when to use the ! separator and the . separator.
from what I understand ! is used like accessing different levels of a file system (ie. C:/Users/Admin/...ect)
where the ! is a stand in for the /
the . is used to access files/elements within the folder.
Sorry I cant be more direct help but there is lots of information out there on opening forms you just got to search around a little bit.
Hopefully I have given you enough information to make some additional educated searches to help point you in the right direction.