I am trying to make a txtbox for access database enter data into seperate Excel and an Access tbls....Would I have to link the two tables or would I have an easier time just doing it in code, and if I did it in code where would I start...PLEASE HELP ME! <
Dim Rst As Recordset
Dim Db As Database
Set Db = CurrentDb
Set Rst = Db.OpenRecordset("Tbl_MyTable", dbOpenDynaset)
Rst.AddNew
Rst.Fields("MyField" = TxtBox123.Value
Rst.Fields("Any other field" = txtWhatever.value
Rst.update
Rst.Close
Let me know if it helps "The greatest risk, is not taking one."
Thanks but there is one problem what the code did was it only could move the text between the different fields in access rather than two different tbls. It probably could be modified to do just that... Thanks for your help and your advice....If you dance on hot coals you'll get burned....Ya it sounds pretty stupid but who ever said I could give advice
for 2 different tables do this:
Dim Rst As Recordset
Dim Db As Database
Set Db = CurrentDb
Set Rst = Db.OpenRecordset("Tbl_MyTable", dbOpenDynaset)
Rst.AddNew
Rst.Fields("MyField" = TxtBox123.Value
Rst.Fields("Any other field" = txtWhatever.value
Rst.update
Rst.Close
Dim Rst2 As Recordset
Dim Db2 As Database
Set Db2 = CurrentDb
Set Rst2 =Db2.OpenRecordset("Tbl_MySecondtbl, dbOpenDynaset)
Rst2AddNew
Rst2Fields("MyField" = TxtBox123.Value
Rst2Fields("Any other field" = txtWhatever.value
Rst2update
Rst2Close "The greatest risk, is not taking one."
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.