Full Version: Insert data from form into a sub form
UtterAccess Forums > Microsoft® Access > Access Forms
I have a main form with a button called "Visitors". When clicked it open another form with a list of people. I have a button on this form which says "Use details" next to each entry.
When I click "Use details" I'd like to take the info from that entry and insert it into a sub form back on my main form.
Any ideas if this is possible?
As a new record in the Subform? It is certainly possible.
You can use the AddNew method on the Recordset of the Subform to add a new Record into the Subform using the data from the second Form (with the "Use Details" button).
Alternatively, you can use code to run an Append Query using the data from the second Form to add a Record into the Table that the Subform is based on then re-query the Subform so that the newly-added Record appears in the Subform.
Ok, how would I go about the AddNew method?
Check Access VBA Help which provides more info than I can in forum posting...
Sorry, it just confused me
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.