Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting record from Subform

Status
Not open for further replies.

261298

Technical User
Mar 31, 2003
10
GB
I currently have a form with a subform which is set to
view as a datasheet which shows mutiple records for the
record set on the mainform (1 to many)I am trying to
select a record in the subform and have the mainform
update, which works with the following code. However the
subform reverts back to the first record not the selected
record. I think that this can be resolved with the use of
Recordsetclone but have been unable to make this work.
Help!

Forms!frmAELog!.Filter = "AENumber=" & Me![AENumber]
Forms!frmAELog.FilterOn = True
 
Mayby I have misunderstood you, but in a one-to-many relation its allways the "one" that controls the "many" not vise-versa.
That is one of the ground rules of database relations. The chauffuer drives not the passengers :-D

Herman
 
Herman

Sorry my mistake the 1 to many relationship is setup to another table.

To clarify, users are first using the mainform to search for existing logs (AENumber) for a given project (ProjectCode), which is using Filter-by-Form, the sub-form then shows a list of existing logs against the "same table" (if any exist). I want the user to be able to select an existing log on the subform, the details of that log are then shown on the mainform and that record remains selected on the subform.
 
You can not show records on the main form sorted by your sub form witch again id sorted by the main form (link) this will result in a circular reference error. However you can have a new main form open and show whatever you need to show about your sub form.

Herman
 
Thanks Herman,
I will try a different approach!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top