Mjhac
05-22-2001, 08:12 AM
I would like to allow what I type in my form, say Field1, (Only once) to go to both tbl1 and tbl2 primary key fields. Can this happen? Someone Please ....
|
View Full Version : I need help on this Form...... Mjhac 05-22-2001, 08:12 AM I would like to allow what I type in my form, say Field1, (Only once) to go to both tbl1 and tbl2 primary key fields. Can this happen? Someone Please .... charityg 05-22-2001, 10:23 AM If you have your form's datasource set to tbl1 then data entry into field1 will input the data as desired into that field. In order to automatically enter this enter tbl2 as well you will need to open a recordset of tbl2. I am assuming that you wish to add a record, and not change an existing value in the primary key field of tbl2. Use this code in the field's afterupdate event, substituting the appropriate names of fields and tables. dim db as database dim rst as recordset set db=currentdb set rst=db.openrecordset("tbl2") with rst .addnew !primarykeyfield=Me!field1 .update .close end with [This message has been edited by charityg (edited 05-22-2001).] |