 |

02-11-2004, 01:53 PM
|
|
Junior Contributor
|
|
Join Date: Dec 2003
Location: PA
Posts: 380
|
|
Need 2nd pair eyes
|
Yelp! I have an error, I am pretty sure where it is but I can not remember how to write it:
MySql = "Insert into Temp_Invoice ([Invoice_ID], [SR_ID], [GL_Code],[Amount],[Journal]," & _
"[CreditFlag],[date],[Insert_Date]) (values " & Chr(34) & Inv & Chr(34) & "," & Chr(34) & sr & Chr(34) & "," & _
Chr(34) & GL & Chr(34) & "," & amt & "," & Chr(34) & Jour & Chr(34) & "," & Chr(34) & Flag & _
Chr(34) & "," & InDate & "," & CurDate & "  "
What is the chr() value that goes around dates?
|
__________________
Swoozie
Somedays you just shouldn't get out of bed in the morning.
|

02-11-2004, 02:01 PM
|
 |
Contributor
|
|
Join Date: Sep 2003
Location: New Jer$ey
Posts: 540
|
|
|
You want the Chr() for "#". You have the Chr for double-quotes.
|
|

02-11-2004, 02:03 PM
|
|
Junior Contributor
|
|
Join Date: Dec 2003
Location: PA
Posts: 380
|
|
Quote: Originally Posted by vbFace You want the Chr() for "#". You have the Chr for double-quotes.
I assumed that was where my problem was that is why I asked what the chr() was for dates i.e., #
Do you know?
|
__________________
Swoozie
Somedays you just shouldn't get out of bed in the morning.
|

02-11-2004, 02:05 PM
|
 |
Contributor
|
|
Join Date: Sep 2003
Location: New Jer$ey
Posts: 540
|
|
In the Immediate window, type
That number will be the one for Chr().
|
|

02-11-2004, 02:08 PM
|
|
Junior Contributor
|
|
Join Date: Dec 2003
Location: PA
Posts: 380
|
|
Quote: Originally Posted by vbFace In the Immediate window, type
That number will be the one for Chr().
dont have a clue what that meant, but
Doesnt matter since there is a syntax error else where prob a comma or something out of place
|
__________________
Swoozie
Somedays you just shouldn't get out of bed in the morning.
|

02-11-2004, 02:11 PM
|
 |
Contributor
|
|
Join Date: Sep 2003
Location: New Jer$ey
Posts: 540
|
|
|
I am assuming you are using VB or VBA within Access. If you don't know what the Immediate Window is, find out! You will love all of the things that you can do with it while debugging. For instance, if you put a breakpoint in the code, you can type in the Immediate Window "? MySql" and it will show you the actual string.
To get the Immediate Window in VB or Access VBA, click VIEW --> Immediate.
|
|

02-11-2004, 03:00 PM
|
|
Centurion
|
|
Join Date: Sep 2003
Location: Bloomington, IL
Posts: 168
|
|
|
Also, you have:
(values
when it should be:
values (
You will also need to have an end parens ie. ) at the end of your Insert statement.
|
|

02-11-2004, 03:02 PM
|
|
Junior Contributor
|
|
Join Date: Dec 2003
Location: PA
Posts: 380
|
|
Quote: Originally Posted by gellerche Also, you have:
(values
when it should be:
values (
You will also need to have an end parens ie. ) at the end of your Insert statement.
Thanks Gellerche
|
__________________
Swoozie
Somedays you just shouldn't get out of bed in the morning.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|