1 Replies - 646 Views - Last Post: 10 May 2021 - 01:28 PM Rate Topic: -----

#1 751730627   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-May 21

Run-time error '3346'

Posted 10 May 2021 - 12:40 PM

Number of query values and destination fields are not the same
The code below brings the error above when executed.

CurrentDb.Execute "INSERT INTO tbl_login (Fullname, Username, Password, Gender, EmailAddress, Phone, RegistrationDate) VALUES ('" & Me.Fullname & "','" & Me.Username & "','" & Me.Password & "''" & Me.Gender & "','" & Me.EmailAddress & "','" & Me.Phone & "','" & Me.RegistrationDate & "')"

:code:


Please assist

This post has been edited by modi123_1: 10 May 2021 - 01:27 PM
Reason for edit:: In the future please use the [code] tags in the editor.


Is This A Good Question/Topic? 0
  • +

Replies To: Run-time error '3346'

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 16253
  • View blog
  • Posts: 64,719
  • Joined: 12-June 08

Re: Run-time error '3346'

Posted 10 May 2021 - 01:28 PM

First off - use parameters and not trying to dynamically create an INSERT statement. It's a huge security flaw your way.

Second, look at the commas. You are missing one between password and gender.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1