473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Variable in INSERT query

Dim Toevoegvariabele As Integer
Toevoegvariabele = DMax("[Paragraafnr]", "tblParagraaf")

If Me.chkDesignAnders = True Then
DoCmd.RunSQL "INSERT INTO tblParagraaf (Paragraafnaam,
VanHoodfstuk) VALUES('" & Me.Bijschrift164.Value & "',4); "
DoCmd.RunSQL "Insert INTO tblInhoudsopgave (Ordernummer, OrdRgl,
Hoofdstuknr, Paragraafnr)" & _
"VALUES ( txtordernr, txtOrdRgl, '4', " &
Toevoegvariabele & ";)"

--

What's wrong with my syntax? I keep getting an error in the
VALUES-line. Probably bevause the syntax of the variable is wrong.
Paragraafnr is AutoNumeric.
Nov 13 '05 #1
1 1540
Hi there,

Perhaps this is the problem?
Hoofdstuknr, Paragraafnr)" & _
"VALUES ( txtordernr, txtOrdRgl, '4', " &
try putting a space before VALUES ie. Hoofdstuknr, Paragraafnr)" & _
" VALUES ( txtordernr, txtOrdRgl, '4', " &

"Theo Jansen" <th********@gmail.com> wrote in message
news:6b**************************@posting.google.c om... Dim Toevoegvariabele As Integer
Toevoegvariabele = DMax("[Paragraafnr]", "tblParagraaf")

If Me.chkDesignAnders = True Then
DoCmd.RunSQL "INSERT INTO tblParagraaf (Paragraafnaam,
VanHoodfstuk) VALUES('" & Me.Bijschrift164.Value & "',4); "
DoCmd.RunSQL "Insert INTO tblInhoudsopgave (Ordernummer, OrdRgl,
Hoofdstuknr, Paragraafnr)" & _
"VALUES ( txtordernr, txtOrdRgl, '4', " &
Toevoegvariabele & ";)"

--

What's wrong with my syntax? I keep getting an error in the
VALUES-line. Probably bevause the syntax of the variable is wrong.
Paragraafnr is AutoNumeric.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Spam sucks | last post by:
hello, i want to have an image in a variable so i can show it were ever i want the only catch is that i want the image to be called in the same page, i found this script but the problem is that...
5
by: Dynamo | last post by:
Hello again ;-) What is the correct syntax to use when inserting a value into a table that contains a variable name with spaces. This works $query = "INSERT INTO Catalogue (Author) VALUES...
6
by: BigDadyWeaver | last post by:
I am using the following code in asp to define a unique and unpredictable record ID in Access. <% 'GENERATE UNIQUE ID Function genguid() Dim Guid guid =...
7
by: Robert Brown | last post by:
Is there a way to use PreparedStatements (or bind variables) with SQL statements that have a variable number of arguments. For example, I have an array of IDs for employees of a certain type and I...
1
by: Otto Porter | last post by:
/*Given*/ CREATE TABLE ( IDENTITY (1, 1) NOT NULL , NULL , (2) NULL , NULL , CONSTRAINT PRIMARY KEY CLUSTERED (
7
by: Richard Hollenbeck | last post by:
Help! I don't know why this isn't working: Private Sub Combo9_Change() Dim UsersCourseSelection As String UsersCourseSelection = Me("Combo9").Value Combo13.Visible = True 'the following...
1
by: stephane | last post by:
I have a problem which must be in this : print" <script type='text/javascript'> document.location.replace('http://127.0.0.1/add_task.php?req_id={$maxValue}&tk_request_name={$req_name}');...
2
by: Boujii | last post by:
Greetings, I have been attempting to make a drop down menu of countries. From this menu I wish to create a variable in order to INPUT into mysql database. I have no trouble making the drop down menu,...
2
by: Konstantinos Pachopoulos | last post by:
Hi, i have a problem, the source of which is probably the fact, that i have not understood how to declare global variables - I use the Jython compiler, but i think this is a Python issue... ...
9
by: FooFighter | last post by:
I'm having a bear of a time here. I have a table that I want the user to be able to insert new data into (this new data will only be 1 letter). Anyway I've made a small query that accepts an...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.