473,385 Members | 1,838 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,385 software developers and data experts.

Run Time Error 3075 in my SQL Insert Into

21
I want to add a value to a subform in Access using the SQL Insert Into Statement, Im trying to do it this way, because If I do it with vba code, the table randomly just creates a completely new record, it ends up messing things up...All I want is to try this method with the field that is giving me problems when I add the field, but now it says there's a syntax error and I am having trouble finding it.

Expand|Select|Wrap|Line Numbers
  1. CurrentDb.Execute " INSERT INTO qrySubformAppoints(ClientName) VALUES(" & Me.cboClient "')"
Jun 28 '16 #1

✓ answered by jforbes

There are a couple syntax errors. This might work:
Expand|Select|Wrap|Line Numbers
  1. CurrentDb.Execute " INSERT INTO qrySubformAppoints (ClientName) VALUES ('" & Me.cboClient & "')"
It makes me nervous that you are attempting to insert records into a Query. Depending on how the query is written, it may not be updatable, which will cause the insert to fail. Typically records are inserted into Tables.

2 1979
jforbes
1,107 Expert 1GB
There are a couple syntax errors. This might work:
Expand|Select|Wrap|Line Numbers
  1. CurrentDb.Execute " INSERT INTO qrySubformAppoints (ClientName) VALUES ('" & Me.cboClient & "')"
It makes me nervous that you are attempting to insert records into a Query. Depending on how the query is written, it may not be updatable, which will cause the insert to fail. Typically records are inserted into Tables.
Jun 28 '16 #2
CVAR
21
now it works, I had to use the table instead, thanks ;)
Jun 28 '16 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: jr | last post by:
Hello everyone! I am new to this sort of postings so I'm not even sure if this is the correct place to start. Anyway, I would realy appreciate any help. I have a some VBA code that works quite...
6
by: Nadnerb78 | last post by:
Please see code below: strSQL = "SELECT Max(EntryType) AS MaxOfEntryType " & _ "FROM tblForecastData GROUP BY BusinessLine, , Week " & _ "HAVING ((()='" & xx & "') AND ((Week)=" & xx & ")) " ...
5
by: Ledo | last post by:
I have a form that I want to show invoices in a date range. When clicking on the button I get the following error: Run Time Error 3075 Syntax error (missing operator) in query expression...
22
by: ozgenaga | last post by:
Hi guys, I am trying to insert new data records to a table but I am getting a run-time error. I would appreciate any kind of help. Here is my code: Sub WorstQueryEver() Dim db As...
4
by: srinathvs | last post by:
Hi, I have an access db that I am trying to query from a vb6 program. I've the following code: Dim sSQLQuery As String sSQLQuery = "SELECT * FROM TblData WHERE ID = " & Chr(39) & ID &...
2
by: tujurikkuja | last post by:
Private Sub Form_Load() Text9.value = DLookup("oleku_nimi", "", "oleku_id= " & Me.oleku_id) End Sub This should fill a field on a subform. When I run just the subform then it works fine. But...
2
by: Vasago | last post by:
I can't seem to get this dlookup to work correctly. I have double check all the spellings. This is the error I'm Receiving. Run-time error '3075': Syntax error in query expression ' =...
2
by: pptechs | last post by:
Hello. In dying need of assistance. All I am trying to do is search a table for a valid user ID for a form login screen and I am getting error : "Run-time error 3075 syntax error (missing...
18
by: W4FF | last post by:
I'm having issues with Access 2010, the interface includes the following input options:Last Name, First Name, SSN, and Birth date. Access was working great since 2012 and all of a sudden we are...
1
by: Vasago | last post by:
I have narrowed it down to .Driver) =" & Me!. My employees do have a comma in their names. Thank you for your help. Error Code says: Run-time error '3075' Syntax error(comma) in query...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
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 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.