dbTalk Databases Forums  

Adding a record in a subform

comp.database.ms-access comp.database.ms-access


Discuss Adding a record in a subform in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rrk
 
Posts: n/a

Default Adding a record in a subform - 05-24-2004 , 12:55 AM






Hi all,

How can I add a row in a subform from code? I have a form named
"papers" containing textboxes txt_papers_id, txt_papers_title,
txt_papers_location bound to corresponding fields in table1. A
subform keywords_subform contains textboxes txt_papers_id and
txt_keywords_id bound to columns in table2. A listbox list_keywords is
populated by column "keywords_id" from table3. Table1, table2 and
table3 have 1--M--1 relatiionship. When I double-click an item in
list_keywords, I find out whether the corresponding value
(keywords_id) is already present in the subform, and if it doesn't,
then insert a row in it. I am so far been able to search the subform
and determine whether the value exists in it or not by using the
creating a recordset object and assigning to it the
form.recordsetclone property of the subform. However, when I insert a
row in it, nothing happens to the subform. I think the new object is
just a copy of the subform's recordset, not its reference. It may be
simple, but I don't know how to insert a row by using code. I can use
SQL INSERT, but don't want to add the record directly to the table and
istead want to use the form to handle it.

Any suggestion is appreciated.

rrk

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.