writing a new record to an unrelated table (1 Viewer)

gregorg

Registered User.
Local time
Today, 21:45
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
 

gregorg

Registered User.
Local time
Today, 21:45
Joined
Jul 26, 2006
Messages
56
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.
 

petehilljnr

Registered User.
Local time
Today, 13:45
Joined
Feb 13, 2007
Messages
192
DoCmd.RunSQL "INSERT INTO MyTable (Field1, Field2) VALUES (Value1, Value2)"

or

CurrentDB.Execute "INSERT INTO MyTable (Field1, Field2) VALUES (Value1, Value2)"
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 21:45
Joined
Sep 12, 2006
Messages
15,680
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

Top Bottom