writing a new record to an unrelated table

gregorg

Registered User.
Local time
Today, 14:36
Joined
Jul 26, 2006
Messages
56
hi,

i have a form "main" and a sub form "submain" i have some code in the sub form on a button click event. i need to take the infomation in the current record in the sub form and a piece of infomation in the main form, put them together and write the data as a new record to an unrealted table ?
It is hard to access the main form form the sub form and I don't know how to write the appened infomation to the table as a new record.

any help ?

gregor
 
how do i

access a text box.text from a subform ie from the parent container ?

how do i write a new record to an unrelated table ?

g.
 
DoCmd.RunSQL "INSERT INTO MyTable (Field1, Field2) VALUES (Value1, Value2)"

or

CurrentDB.Execute "INSERT INTO MyTable (Field1, Field2) VALUES (Value1, Value2)"
 
re the form/subform

in the parent put

subformname!fieldname

subformname is the name of the CONTROL on the main form

form the subform its

parent!fieldname
 

Users who are viewing this thread

Back
Top Bottom