Solved

Insert and Update Masked Edit Boxes

Posted on 1998-06-28
3
156 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

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