View Full Version : Subform datasheet and main form linkage


KyleB
10-17-2001, 08:33 AM
The problem I'm having here is a situation of updating and/or adding to existing records. So I've based a subform on a query that lists the current, pertinent records from my main table, and the main form is merely a duplicate of the original data entry form which was used to enter the data. What I can't figure out how to do is link the two so that the subform shows all of the current pertinent info and allow the user to select one of the records in the subform, and cause it to populate the entry form with the existing data, for modification. As the other option, I want to allow entry of a new dataset if necessary. The problem seems to be that if I link the primary fields of the form and subform then I get no data in my data sheet subform because the main form is blank, even though it's based on a seperate query.

Kyle B.

PS What I've got here is a forecast work entry form, where I want to allow modification or addition to work that's forecast to be completed for this month, the query merely looks in the table for existing data that is currently forecast. This data is displayed int he subform, and I want to be able to select one of those entries in the subform to modify the data, or create a new entry.

Pat Hartman
10-17-2001, 09:28 AM
You'll have an easier time with this process if you change your concept somewhat. Make the form you currently are using as a subform the mainform. Then with a button or doubleclick event pop open the details of the selected record. That way you can use the master/child links to synchronize both forms. I'm not sure you will be able to get your current method to work properly because the mainform is controlling what is displayed on the subform (that is the natural order of things) and you want it to work backwards.

KyleB
10-18-2001, 10:03 AM
Thanks, that fixed the problem I was having. though I had to modify my form subsequently to fix error checking, I was able to use this method to straighten out the problem. Thanks for the help.

Kyle