Unbound form to enter values in table

mothi

Registered User.
Local time
Today, 14:57
Joined
Dec 26, 2009
Messages
111
Hi,
THere are seven tables linked to each other by primary key. I have an Unbound form with an one unbound textbox and one bound textbox , users enter values in the unbound Textbox so . the Values entered in the unbound textbox should be added to all the seven tables . I used this code to add values in all the tables without a hitch. But I need to add values only in those tables when bound textbox value is equal to primary key value in the tables.


Code to add values in unbound textbox to the tables. ( Code pasted here is the code i am testing with two sample linked with pimary key " cust_id " and "id")

Dim dbs As Database

Dim rst As Recordset

Dim qst As Recordset

Set dbs = CurrentDb

Set rst = dbs.OpenRecordset("tbl_customer", dbOpenTable, dbAppendOnly)

Set qst = dbs.OpenRecordset("tbl_Providers", dbOpenTable, dbAppendOnly)



With rst

.AddNew

!cust_id = Me.frm_test

.Update

End With
rst.Close


With qst

.AddNew

!id = Me.frm_test

.Update

End With
qst.Close



Set dbs = Nothing
 
Last edited:
Do not post the same question more than once. If you aren't sure which category to post in, you can IM the moderators to ask or post and then report your post if you want it moved to a different category. I've removed your duplicate posts and left the last post you did.
 

Users who are viewing this thread

Back
Top Bottom