?
Solved

Run time erro 3075 INSERT INTO SQL

Posted on 2007-08-09
2
Medium Priority
?
255 Views
Last Modified: 2013-11-05
I have a bunch of textboxes on my form which are not visible but are populated by my listboxes. I'm trying to INSERT INTO the values from the textboxes into my table. I'm keep getting this error 3075. Can you anyone take a loot at it. My fields are listed below:

STOCKING_LOCATION_NAME=txtNotAtLocation
PRODUCT_BARCODE=txtPN
PART_NUMBER=txtPartNumber
DESCRIPTION=txtDESCRIPTION
txtSTOCKUOM
STOCKING_QTY=txtSTOCKQTY
SELLING_UOM=txtSELLUOM
SellPrice=txtSELLPRICE
PrintCount=txtconversion

All are text except for txtSTOCKQTY, txtSELLPRICE, and txtCONVERSION. These are integers.

Here is what I have so far. Any help would be awesome.


   Dim strSQL As String
   
strSQL = "Insert Into tblProductLocation "
strSQL=strSQL& "(STOCKING_LOCATION_NAME,PRODUCT_BARCODE,PART_NUMBER,DESCRIPTION,STOCKING_UOM,STOCKING_QTY,SELLING_UOM,SellPrice,PrintCount)"
strSQL = strSQL & "Values ('" & txtNotAtLocation & ",'" & txtPN & "'" & txtPartNumber & "','" & txtDESCRIPTION & "' '" & txtSTOCKUOM & "'"
strSQL = strSQL & " , " & txtSTOCKQTY & ",'" & txtSELLUOM & "'," & txtSELLPRICE & "," & txtconversion & ")"
            DoCmd.RunSQL strSQL
            MsgBox strSQL
           

            Me.lstNotAtLocation.Requery
            Me.lstLocation.Requery
0
Comment
Question by:goingolfn99
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 19667815
strSQL = "Insert Into tblProductLocation "
strSQL=strSQL& "(STOCKING_LOCATION_NAME,PRODUCT_BARCODE,PART_NUMBER,DESCRIPTION,STOCKING_UOM,STOCKING_QTY,SELLING_UOM,SellPrice,PrintCount)"
strSQL = strSQL & "Values ('" & txtNotAtLocation & "','" & txtPN & "'" & txtPartNumber & "','" & txtDESCRIPTION & "', '" & txtSTOCKUOM & "'"
strSQL = strSQL & " , " & txtSTOCKQTY & ",'" & txtSELLUOM & "'," & txtSELLPRICE & "," & txtconversion & ")"
            MsgBox strSQL
            DoCmd.RunSQL strSQL

you had missing some quotes and a comma in the query.
0
 

Author Comment

by:goingolfn99
ID: 19667837
Kind of figured it out, but a quick 500 points for you.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question