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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying data to subform

Status
Not open for further replies.
Jan 28, 2003
149
GB
Hi all

I have a database containing a list of members, and next of kin details. As you can imagine, most NoK share the address with the member. I've created a routine to copy the member's address details to the NoK subform, but can't dump the data.

Does anyone have any idea how I can "copy" the data from the main form to the subform?

Thanks in advance

B.M.
 
I would use an update query to update the data and then requery the subform.

Checkout the following...

Docmd.setwarnings
Docmd.openquery
docmd.runsql
Requery method

You can use either openquery or runsql whichever is your preference... If you have to actually look them up, I am guessing you want openquery.
 
You can, as lameid said, use an updatre query.

CurrentProject.Connection.Execute _
"UPDATE tblNoK SET " & _
"Address1 ='" & Me.txtAddress1 & "'," & _
"Address2 ='" & Me.txtAddress2 & "'," & _
"City =.....

Or just refrence the controls individualy (one record at time, only)
Me.sfrmNextOfKin.Form!txtAddress1 = Me.txtAddress1
 
Wow, sounds more complicated that I'd expected, but I'll check into the openquery.

Cheers

B.M.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top