Anyone Please Help!!! I cant figure thi out!!!!!

  • Thread starter Thread starter Everett Myers via AccessMonster.com
  • Start date Start date
E

Everett Myers via AccessMonster.com

I have a database that contains information that I retrieve through links
tables. I would like to be able to scan through and copy this information
to a locale table.

I have a Parent form that views information from the linked tables via a
query and would like to know how to use code to make a command button that
will take information from the fields in the parent record and input them
into the desired fields in the new record in the child form.

Any help in this would be greatly appreciated. Thanks for your help I am
new and trying to get into this wonderful world of databases.
 
You can start a new record in your local table, then do the following for all
fields you want:

recSet.CursorLocation = adUseServer
recSet.CursorType = adOpenKeyset
recSet.LockType = adLockOptimistic
recSet.Open "[TableName]", dbConn, , , adCmdTable

dbConn.BeginTrans
recSet2.AddNew

recSet!Field1 = Me.Field1 (from the current form)
recSet!Field2 = Me.Field2
..
..
..
recSet.Update
dbConn.CommitTrans

recSet.Close
Set recSet = Nothing
 
That should be:

recSet.AddNew

instead of:

recSet2.AddNew


....My bad...
Dennis said:
You can start a new record in your local table, then do the following for all
fields you want:

recSet.CursorLocation = adUseServer
recSet.CursorType = adOpenKeyset
recSet.LockType = adLockOptimistic
recSet.Open "[TableName]", dbConn, , , adCmdTable

dbConn.BeginTrans
recSet2.AddNew

recSet!Field1 = Me.Field1 (from the current form)
recSet!Field2 = Me.Field2
.
.
.
recSet.Update
dbConn.CommitTrans

recSet.Close
Set recSet = Nothing
---------

All done


Everett Myers via AccessMonster.com said:
I have a database that contains information that I retrieve through links
tables. I would like to be able to scan through and copy this information
to a locale table.

I have a Parent form that views information from the linked tables via a
query and would like to know how to use code to make a command button that
will take information from the fields in the parent record and input them
into the desired fields in the new record in the child form.

Any help in this would be greatly appreciated. Thanks for your help I am
new and trying to get into this wonderful world of databases.
 
Back
Top