Insert into table

siddnave2

Registered User.
Local time
Today, 19:55
Joined
Nov 19, 2015
Messages
16
Hi,

I have written below code for inserting into table tbluser, But
Adding it is giving Run-time error '3061' Too few parameters.Expected 3. Please suggest where i have to correct

tbluser
ID UserName UserLogin Password UserSecurity
1 Naveen Nani **** Admin
2 2022 Blr *** User

CurrentDb.Execute "INSERT INTO tbluser(UserName,UserLogin,Password,UserSecurity)" & "Values(" & Me.TxtUserName & ", " & TxtLogin & ", " & txtPassword & ", " & Me.CmbSecurity & ")"

Thanks in advance.
 
If they are text fields then you need single quotes like:

CurrentDb.Execute "INSERT INTO tbluser(UserName,UserLogin,Password,UserSecurity) VALUES ('" & Me.TxtUserName & "','" & TxtLogin & "','" & txtPassword & "','" & Me.CmbSecurity & "')"
 
Hi Sneuberg,

Thanks worked out for me.

Regards.
 

Users who are viewing this thread

Back
Top Bottom