Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer 32 Lessons    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Developer 32 Lesson 6
Ole Simonsen 
    
2 years ago
due to local settings in Norway (Use of "," instead of "." as decimal sign.) Access gives me an error: Run-time error '3144'
I did change the vba as listed below.
Dim s1 as string
    S1 = FindBetween(S, """EUR"":", "}") ' should be 1
    S1 = Replace(S1, ".", ",")
    EURrate = CDbl(S1)
    Status "Eur :" & S1
    S1 = FindBetween(S, """USD"":", ",")
    S1 = Replace(S1, ".", ",")
    USDrate = CDbl(S1)
    Status "USD :" & S1
    S1 = FindBetween(S, """GBP"":", ",")
    S1 = Replace(S1, ".", ",")
    GBPrate = CDbl(S1)
    Status "GBP :" & S1
    S1 = FindBetween(S, """NOK"":", ",")
    S1 = Replace(S1, ".", ",")
    NOKrate = CDbl(S1)
    Status "NOK :" & S1

    ' check the Euro rate - should be 1
   If EURrate <> 1 Then MsgBox "ERROR: Euro should be 1": Exit Sub
    
    ' set rest of the rates IN NOK
    EURrate2 = NOKrate / EURrate
    USDrate2 = NOKrate / USDrate
    GBPrate2 = NOKrate / GBPrate
    NOKrate2 = NOKrate / NOKrate ' should always be 1

    ' check the NOKrate2 - should be 1
    If NOKrate2 <> 1 Then MsgBox "ERROR: NOK should be 1": Exit Sub
    
    ' set values in table

*   CurrentDb.Execute "UPDATE ValutaT SET ValutaKurs=" & EURrate2 & " WHERE ValutaKode=""EUR"""
    CurrentDb.Execute "UPDATE ValutaT SET ValutaKurs=" & USDrate2 & " WHERE ValutaKode=""USD"""
    CurrentDb.Execute "UPDATE ValutaT SET ValutaKurs=" & GBPrate2 & " WHERE ValutaKode=""GBP"""
    ValutaListeBoks.RowSource = "SELECT ValutaID, Valutatekst, ValutaTegn, ValutaKurs, ValutaDato FROM ValutaT ORDER BY ValutaID"
    Status "Rates updated." & vbNewLine & "EUR:" & EURrate2 & vbNewLine & "USD:" & USDrate2 & vbNewLine & "GBP:" & GBPrate2

*   Results in : Run-time error '3144'
     Syntax error in UPDATE-sentsentence
Sami Shamma  @Reply  
             
2 years ago
The problem could be that the comma is reserved by VBA for its own use. Try the code with another character just to eliminate this possibility.

Sami Shamma  @Reply  
             
2 years ago
This next video may give you hints on how to deal with this issue.

Escape Double Quotes

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 32 Lessons.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/30/2026 3:55:21 AM. PLT: 1s