sub form to main form

SteveE

Registered User.
Local time
Today, 08:26
Joined
Dec 6, 2002
Messages
221
I have a sub form on my main form, this subform reports all the bookings equal to the date on the main record form (Child and master fields are linked by the date). I would like to be able to select a record in the subform and in so doing the main form record would now reflect the chosen record. Could any one advise my best methord?.

thanks in advance
 
I don't get exactly what you're asking. If the mainform has records and those records have "child" records in the subform, then don't all the records in the subform relate back to the single record in the main form? I guess what I'm asking is, what exactly do you want to have happen when a record is selected in the subform?
 
Sorry I'll explain,
The main form is mainly data entry and shows only the current record, the sub form is positioned along the right side of the screen and is in datasheet view listing all the records for the date on the main form. I wish the user to be able to with the double click event etc to select the record from the sub-form and this action would bring all the details into the main form making the secected one the now current record. I have attached a snapshot which I think will explain.

thanks
 

Attachments

  • booking.jpg
    booking.jpg
    97.4 KB · Views: 122
I see. What people typically do is set up two subforms on their mainform. The main form contains the date. Once that date is selected, all the transactions for the date are listed in the subform. When a record in that subform is selected, the details of that transaction are listed in the 2nd subform.

The problem handling the data your way is how do you bind the controls to the underlying table/query? In other words, you are feeding a certain set of records into your main form. For the moment, let's say it's all records. Then when you click on a record in the main form, your subform gets filtered to just show the records that occur on the date selected on the main form. But what happens now when you select a record on the subform? You now wish to alter the main form's recordsource to show only the record that matches the one selected from the subform. You see where I'm going with this? It's all technically possible to do the way you want, but it's a bit convoluted.

What I would do is use the two subform approach. You can design the second subform so that it looks like it's part of the main form if you like.
 
Ok thanks for that, I'll have a re-think

regards
 

Users who are viewing this thread

Back
Top Bottom