insert into a table from a from field in ms access

mana

Registered User.
Local time
Today, 13:47
Joined
Nov 4, 2014
Messages
265
Hello

i want to insert the values from a from field into a table i wrote the below code but it doesn't work can you help me pleasE?
i want to add some values from other forms but i don't know what to write cna you help please?

DoCmd.RunSQL (" insert into tbl_userinformation (Anwendung) values (" & Me.Label135 & ");")

and the error is :
object doesn't support this property or method
thank you
 
labels do not have a value, you need to use a textbox or any control which does have a value (e.g. combobox)
 
hello

thank you for the answer
i also wrote the below code but i have error in below line
i don't know what to write instead of that
can you help me please?

Dim db As Database
Dim rec As Recordset
Set db = CurrentDb
Set rec = db.OpenRecordset("Select * from tbl_userinformation")
rec.AddNew
rec("Anwendung") = Me.Label135.Caption
rec("actualdate") = !Forms!frm_main!Text0.Value

rec.Update
Set rec = Nothing
Set db = Nothing
 

Users who are viewing this thread

Back
Top Bottom