Solved

Insert and Update Masked Edit Boxes

Posted on 1998-06-28
3
155 Views
Last Modified: 2010-05-03
Using VB 5.0, I am having trouble with the Insert Into and Update statements when saving to the
database.  I am using the following syntax ...  INSERT INTO (field1, field2,...) VALUES ('" & textbox & "','" & mskedbox1 & "'...) and I get the error :  "Syntax error in insert into statement".  The same happens with update.  I've narrowed  the problem down to the maskedit boxes (the textboxes work fine alone).  Suggestions?
0
Comment
Question by:porter062898
3 Comments
 
LVL 2

Expert Comment

by:richtsteig
ID: 1464462
Have you checked the resulting string in both cases?

I use to include something like

#if sqltrace
clipboard.settext sqlstatement
if msgbox("continue?",vbyesno) = vbno then exit sub
#end if

when I am in an early state of developing.

This allows me to verify the SQL-statements in the
Access environment.
0
 

Author Comment

by:porter062898
ID: 1464463
When I debug, I find that the correct string is returned, but the error still occurs.  
0
 
LVL 3

Accepted Solution

by:
AndreasSchindler earned 100 total points
ID: 1464464
Try a Textbox instead of the maskes Edit. If you get an error you have a Problem according the database field and not the MaskedEditControl.
Is the MAskesEditField as String or a Number ?
Try " instead of ' ( & """,""" & ...)
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

806 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