[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

compile error in query expression

Posted on 2017-08-13
8
Medium Priority
?
57 Views
Last Modified: 2017-08-14
I had this question after viewing How to show a web linked image on a report.

In the trial database I have got the following errors:


Screen-Shot-2017-08-13-at-09.39.29.png
and

Screen-Shot-2017-08-13-at-09.39.21.png
can you help?
0
Comment
Question by:João serras-pereira
  • 3
  • 3
  • 2
8 Comments
 
LVL 40

Expert Comment

by:als315
ID: 42252767
I have no problems with Gustav's sample. It is call of function. May be you have not allowed module execution? What Access version is used?
Can you open record source of this form? Can you run this query?
0
 

Author Comment

by:João serras-pereira
ID: 42252769
access 2016
0
 

Author Comment

by:João serras-pereira
ID: 42252771
when I try to run the form it crashes....
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 40

Expert Comment

by:als315
ID: 42252784
Please, open module and compile it
0
 
LVL 52

Expert Comment

by:Gustav Brock
ID: 42252945
All the green corners indicate missing fields, so it looks like you have deleted the Flags table.

/gustav
0
 
LVL 52

Accepted Solution

by:
Gustav Brock earned 2000 total points
ID: 42253451
If (as) you use Access 64-bit, the API declaration must use PtrSafe. It can be done like this:

#If VBA7 Then
Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" ( _
    ByVal pCaller As Long, _
    ByVal szURL As String, _
    ByVal szFileName As String, _
    ByVal dwReserved As Long, _
    ByVal lpfnCB As Long) _
    As Long
#Else
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" ( _
    ByVal pCaller As Long, _
    ByVal szURL As String, _
    ByVal szFileName As String, _
    ByVal dwReserved As Long, _
    ByVal lpfnCB As Long) _
    As Long
#End If

Open in new window


I will later adjust the code in the article the question refers to.

/gustav
0
 

Author Closing Comment

by:João serras-pereira
ID: 42253632
Perfect!!!!! IT IS WORKING!!!!! thanks a lot!!!
joao
0
 
LVL 52

Expert Comment

by:Gustav Brock
ID: 42253638
You are welcome!

/gustav
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

872 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