al ejecutar - db.Execute "INSERT INTO BaseDatosMatriz" _
-
& "([CEDULA CLIENTE],[ID_JURIS],[ID_ESP],[TIPO DE PROCESO],[RADICADO]," _
-
& "[DEMANDATES],[DEMANDADOS],[CAUSANTE],[CURADOR],[FECHA_DE_REGISTRO]," _
-
& "[NUMERO CARPETA],[CAJA],[NOTAS],[APDE_DEMANDANTES],[APDE_DEMANDADOS],[FECHA_FIN])" _
-
& "values( Form![CEDULA CLIENTE],Form![ID_JURIS],Form![ID_ESP],Form![TIPO DE PROCESO],Form![RADICADO]," _
-
& "Form![DEMANDATES],Form![DEMANDADOS],Form![CAUSANTE],Form![CURADOR],Form![FECHA_DE_REGISTRO]," _
-
& "Form![NUMERO CARPETA],Form![CAJA],Form![NOTAS],Form![APDE_DEMANDANTES],Form[APDE_DEMANDADOS],Form![FECHA_FIN]);"
-
-
db.Close
Al llenar formulario me indica error 3061 en tiempo de ejecucion, se esperaba 16 parametros aun colocandole todos los parametros en cada campo. alguien me puede ayudar con eso
==============================================
English Translation:
when executing
{CODE}
When filling out the form it indicates error 3061 at runtime, 16 parameters were expected even placing all the parameters in each field. can someone help me with that
@twinnyfo:
One day I keep you on your toes, the next day you keep me on my toes! (LOL) P.S. - We also have to take into consideration that there may be 1 or more DATE/TIME Fields that will also have to be Delimited. As you stated, we need an English Version along with all Data Types for Fields involved in the SQL Statement. Take care and stay safe.
15 2136
Eddy,
First, Welcome to Bytes!
Second, we request posters to use English on our forum, so please do so, if possible. We always try to work through language challenges with you.
Third, fundamentally, there may not be be anything wrong with your Code, but MS Access has a tendency to not like using references to form controls directly from within its executable functions. What I mean by that is that it is often better (and in practice I always do this) to generate a finished string variable and then send that string to the function. You also need to be careful to use the proper punctuation and syntax here. This also allows you to evaluate your string before you use it and examine that string within the Query Builder of Access.
Fourth, it is unclear what "Form!" refers to. as it stands, Access has no idea what you are telling it to get. If this code is resident on a form, and the items in square brackets are controls on that Form, then the proper sytax would be simply " Me. ". I am assuming this is the case, so I have modified that in your code.
As a final recommendation, as I do with all examples of this sort, I highly recommend that you name your controls something other than merely the name of the field to which they apply. So, a text box that holds the data for [CEDULA CLIENTE] has a name of txtCedulaCliente. This allows Access to differentiate between the text box and the underlying field--which is sometimes helpful, not to mention the ambiguities that are raised when you don't employ this practice.
Also,it looks like you may have missed a few required spaces. See below: - Option Explicit
-
Option Compare Database
-
-
Private Sub YourSubName()
-
Dim strSQL As String
-
Dim db As DAO.Database
-
-
strSQL = _
-
"INSERT INTO BaseDatosMatriz (" & _
-
"[CEDULA CLIENTE], " & _
-
"[ID_JURIS], " & _
-
"[ID_ESP], " & _
-
"[TIPO DE PROCESO], " & _
-
"[RADICADO], " & _
-
"[DEMANDATES], " & _
-
"[DEMANDADOS], " & _
-
"[CAUSANTE], " & _
-
"[CURADOR], " & _
-
"[FECHA_DE_REGISTRO], " _
-
"[NUMERO CARPETA], " & _
-
"[CAJA], " & _
-
"[NOTAS], " & _
-
"[APDE_DEMANDANTES], " & _
-
"[APDE_DEMANDADOS], " & _
-
"[FECHA_FIN]) "
-
strSQL = strSQL & _
-
"VALUES (" & _
-
Me.[CEDULA CLIENTE] & ", " & _
-
Me.[ID_JURIS] & ", " & _
-
Me.[ID_ESP] & ", " & _
-
Me.[TIPO DE PROCESO] & ", " & _
-
Me.[RADICADO] & ", " & _
-
Me.[DEMANDATES] & ", " & _
-
Me.[DEMANDADOS] & ", " & _
-
Me.[CAUSANTE] & ", " & _
-
Me.[CURADOR] & ", " & _
-
Me.[FECHA_DE_REGISTRO] & ", " & _
-
Me.[NUMERO CARPETA] & ", " & _
-
Me.[CAJA] & ", " & _
-
Me.[NOTAS] & ", " & _
-
Me.[APDE_DEMANDANTES] & ", " & _
-
Me.[APDE_DEMANDADOS] & ", " & _
-
Me.[FECHA_FIN] & ");"
-
-
Set db = CurrentDB()
-
db.Execute
-
db.Close
-
-
End Sub
Hope this hepps!
My guess would be that you are not Delimiting Text Fields: - Dim strSQL As String
-
Dim strFName As String
-
Dim strLName As String
-
Dim lngZip As Long
-
Dim db As DAO.Database
-
-
strFName = "A"
-
strLName = "Dezii"
-
lngZip = 9999
-
-
strSQL = "INSERT INTO Employees([First Name],[Last Name],[Zip]) VALUES('" & strFName & "','" & _
-
strLName & "'," & lngZip & ");"
-
Set db = CurrentDb
-
-
db.Execute strSQL, dbFailOnError
-
-
db.Close
-
Set db = Nothing
ADezii,
Thanks for the reminder that the syntax for numeric and string values will be different!
Always keeping me on my toes!
@twinnyfo:
One day I keep you on your toes, the next day you keep me on my toes! (LOL) P.S. - We also have to take into consideration that there may be 1 or more DATE/TIME Fields that will also have to be Delimited. As you stated, we need an English Version along with all Data Types for Fields involved in the SQL Statement. Take care and stay safe.
buenas tardes,gracias por darme la oportunidad de solicitar el problema. ya coloque la forma que tu lo requieres. pero cuando al ejecutar nos indica que tiene error en INSERT INTO, en la instruccion "db.Execute strSQL", por favor si puedes dar una ayuda. Anexo las notas de auxiliar.
Dim strSQL As String
Dim db As DAO.Database
strSQL = _
"INSERT INTO BaseDatosMatriz (" & _
"[CEDULA CLIENTE]," & _
"[ID_JURIS]," & _
"[ID_ESP]," & _
"[TIPO DE PROCESO]," & _
"[RADICADO]," & _
"[DEMANDANTES]," & _
"[DEMANDADOS]," & _
"[CAUSANTE]," & _
"[CURADOR]," & _
"[FECHA_DE_REGISTRO]," & _
"[NUMERO CARPETA]," & _
"[CAJA]," & _
"[NOTAS]," & _
"[APDE_DEMANDANTES]," & _
"[APDE_DEMANDADOS]," & _
"[FECHA_FIN])"
strSQL = strSQL & _
"values( " & _
Me.CEDULA_CLIENTE & ", " & _
Me.ID_JURIS & ", " & _
Me.ID_ESP & ", " & _
Me.TIPO_DE_PROCESO & ", " & _
Me.RADICADO & ", " & _
Me.DEMANDANTES & ", " & _
Me.DEMANDADOS & ", " & _
Me.CAUSANTE & ", " & _
Me.CURADOR & ", " & _
Me.FECHA_DE_REGISTRO & ", " & _
Me.NUMERO_CARPETA & ", " & _
Me.CAJA & ", " & _
Me.NOTAS & ", " & _
Me.APDE_DEMANDANTES & ", " & _
Me.APDE_DEMANDADOS & ", " & _
Me.FECHA_FIN & ");"
Set db = CurrentDb()
db.Execute strSQL
db.Close
nota: todos los campos son de texto y dos Fechas dd/mm/aaaa
Muchas Gracias.
EDDY
Necesitamos la traducción al inglés para poder ayudarlo, así como todos los tipos de datos en la tabla BaseDatosMatriz.
We need the English Translation in order to assist you, as well as all the Data Types in the BaseDatosMatriz Table.
good afternoon, thanks for giving me the opportunity to request the problem. I already put the form that you require. but when when executing it tells us that it has an error in INSERT INTO
Abrir en Google Traductor
Com
Dim strSQL As String
Dim db As DAO.Database
strSQL = _
"INSERT INTO BaseDatosMatriz (" & _
"[CEDULA CLIENTE]," & _
"[ID_JURIS]," & _
"[ID_ESP]," & _
"[TIPO DE PROCESO], "& _
" [RADICADO], "& _
" [DEMANDANTES], "& _
" [DEMANDADOS], "
"[FECHA_DE_REGISTRO]," & _
"[NUMERO CARPETA]," & _
"[CAJA]," & _
"[NOTAS]," & _
"[APDE_DEMANDANTES]," & _
"[APDE_DEMANDADOS]," & _
" [FECHA_FIN]) "
strSQL = strSQL & _
" valores ("& _
Me.CEDULA_CLIENTE &", "& _
Me.ID_JURIS &", "& _
Me.ID_ESP &", "& _
Me.TIPO_DE_PROCESO &", " & _
Yo.RADICADO & "," & _
Yo.DEMANDANTES & ", "& _
Me.DEMANDADOS &", "& _
Me.CAUSANTE &", "& _
Me.CURADOR &", "& _
Yo.FECHA_DE_REGISTRO & "," & _
Yo.NUMERO_CARPETA & "," & _
Yo.CAJA & "," & _
Yo.NOTAS & "," & _
Yo.APDE_DEMANDANTES & "," & _
Yo.APDE_DEMANDADOS & " , "& _
Me.FECHA_FIN &"); "
Set db = CurrentDb ()
db.Execute strSQL
db.Close
note: all fields are text and two Dates mm / dd / yyyy
EDDY
What two Fields are the Date Fields?
good afternoon, thanks for giving me the opportunity to request the problem. I already put the form that you require. but when you can execute it tells us that it has an error in INSERT INTO, in the instruction "db.Execute strSQL", please give a help. Annex the auxiliary notes.
Dim strSQL As String
Dim db As DAO.Database
strSQL = _
"INSERT INTO BaseDatosMatriz (" & _
"[CEDULA CLIENTE]," & _
"[ID_JURIS]," & _
"[ID_ESP]," & _
"[TIPO DE PROCESO]," & _
"[RADICADO]," & _
"[DEMANDANTES]," & _
"[DEMANDADOS]," & _
"[CAUSANTE]," & _
"[CURADOR]," & _
"[FECHA_DE_REGISTRO]," & _
"[NUMERO CARPETA]," & _
"[CAJA]," & _
"[NOTAS]," & _
"[APDE_DEMANDANTES]," & _
"[APDE_DEMANDADOS]," & _
"[FECHA_FIN])"
strSQL = strSQL & _
"values( " & _
Me.CEDULA_CLIENTE & ", " & _
Me.ID_JURIS & ", " & _
Me.ID_ESP & ", " & _
Me.TIPO_DE_PROCESO & ", " & _
Me.RADICADO & ", " & _
Me.DEMANDANTES & ", " & _
Me.DEMANDADOS & ", " & _
Me.CAUSANTE & ", " & _
Me.CURADOR & ", " & _
Me.FECHA_DE_REGISTRO & ", " & _
Me.NUMERO_CARPETA & ", " & _
Me.CAJA & ", " & _
Me.NOTAS & ", " & _
Me.APDE_DEMANDANTES & ", " & _
Me.APDE_DEMANDADOS & ", " & _
Me.FECHA_FIN & ");"
Set db = CurrentDb()
db.Execute strSQL
db.Close
note: all fields are text and two dates mm / dd / yyyy
EDDY
Estas son las dos fechas: Gracias
[fecha_de_registro]," & _
" [fecha_fi
ESTAS SON LAS FECHAS, GRACIAS
ME.FECHA_DE_REGISTRO & "," & _
Me.FECHA_FIN &")
[fecha_de_registro], "& _
" [fecha_fin])"
Try the following adjustment ([FECHA_DE_REGISTRO] & [FECHA_FIN] are Dates): - '***** SOME CODE INTENTIONALLY OMITTED *****
-
strSQL = strSQL & _
-
" VALUES('" & _
-
Me.CEDULA_CLIENTE & "', '" & _
-
Me.ID_JURIS & "', '" & _
-
Me.ID_ESP & "', '" & _
-
Me.TIPO_DE_PROCESO & "', '" & _
-
Me.RADICADO & "', '" & _
-
Me.DEMANDANTES & "', '" & _
-
Me.DEMANDADOS & "', '" & _
-
Me.CAUSANTE & "', '" & _
-
Me.CURADOR & "', #" & _
-
Me.FECHA_DE_REGISTRO & "#, '" & _
-
Me.NUMERO_CARPETA & "', '" & _
-
Me.CAJA & "', '" & _
-
Me.NOTAS & "', '" & _
-
Me.APDE_DEMANDANTES & "', '" & _
-
Me.APDE_DEMANDADOS & "', #" & _
-
Me.FECHA_FIN & "#);"
-
'***** SOME CODE INTENTIONALLY OMITTED *****
Thank you ADezii. That worked! Eureka !, Eureka !, Thank God and you. I have also been retired for 20 years, 3 months ago I have been learning Access, to make a legal system for my brother-in-law. Well thank you very much. God bless you.
You are quite welcome and bless you also. Good Luck with your Project and stay safe.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Steve |
last post by:
I just spent waaaaaaaaaaaayy too much time trying to track down an error that was incorrectly reported just now, and I would like to see if someone
can explain to me why it was reported that way.
...
|
by: Tu Quach |
last post by:
I have an error with the following code
Dim rs As DAO.Recordset
Set dbs = CurrentDb
strSQL = "SELECT * FROM table1 WHERE table1.Schedule_Item LIKE
""AA"" AND table1.Item1 = " & Form!Item1
|
by: Jon |
last post by:
Hello all:
I'm trying to modify an existing db for someone who wants to set
appointments in a customer db. They want to prevent someone from
double booking appts.
I've developed a few lines...
|
by: lgbjr |
last post by:
Hello All,
I have some pictureboxes on a VB.NET form that are linked to an AccessDB. If
the user wishes to open or edit an image, I need to save the image in the
picturebox to a temp file, then...
|
by: mike_li |
last post by:
On Window 2000 Professional Server
DB2 UDB
Level:
DB2 code release "SQL07029" with level identifie
"030A0105" and informational tokens "DB2 v7.1.0.98", "n040510" and
"WR21337".
In the...
|
by: sethuganesh |
last post by:
HI,
i have ported vc++ 6.0 code to visual studio 2005. During batch build
in debug mode i din't get any error.But if i build the same in release
mode i am getting the following error.
...
|
by: technocraze |
last post by:
Hi guys,
I have encountered this error when updating the values to the MS Acess table.
Error : Update on linked table failed. ODBC sql server error Timeout expired. MS Acess is my front end and...
|
by: Ooi Lee Chin |
last post by:
I set my IIS by using the Basic Authentication. It will display the authentication dialog box to let user re-enter username and password. After 3 time it will reporting an error to user. The error...
|
by: lingjun |
last post by:
Hi,
I am taking my first programing course in college... and I am completely lost on this assignment. I am not sure what is wrong with my current code. Any help will be appreciate it... thanks!
...
|
by: baruc308 |
last post by:
I cant run this. please help! the error is
run-time error 3061 too few parameters expected 1
in this line --------->> Set rs = db.OpenRecordset <---- below
Public Function...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |