Results 1 to 7 of 7
  1. #1
    hemaazez is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Posts
    23

    PtrSave attribute

    Dear All
    can you help me please
    i have this code in my database
    Private Sub Form_timer()
    Static iCount As Integer
    iCount = iCount + 1
    If iCount = 10 Then
    Me.TimerInterval = 0
    Call generateEmail("select * from qryduein30days")
    Call generateEmail2("select * from qryDuein30Days2")
    Call generateEmail3("select * from qryDuein30Days3")
    Call generateEmail4("select * from qryDuein30Days4")
    Call generateEmail5("select * from qryDuein30Days5")


    If Me.TimerInterval = 0 Then
    Me.TimerInterval = 125
    End If
    Exit Sub
    End If
    End Sub


    when any one open the database in another computers this message appear ( the expression on timer you entered as event property setting produced the following error : the code in this project must be updated for use on 64 bit system please review and update declare statements and then mark them with the PtrSave attribute )
    what is the right edites in the code - best regards

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    this code is not where the error is.
    Somewhere you have declared API functions....
    like:
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long
    Private Declare Function GetDesktopWindow Lib "user32" () As Long

    these need the PtrSave:
    Code:
    #if Win64 then
       Declare PtrSafe Function MyMathFunc Lib "User32" (ByVal N As LongLong) As LongLong
    #else
       Declare Function MyMathFunc Lib "User32" (ByVal N As Long) As Long
    #end if

  3. #3
    hemaazez is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Posts
    23
    Thank you very much for your support
    regards

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  5. #5
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Likely that somewhere is here: generateEmail
    but the problem might exist in many places. Suggest you search for a term like "Declare Function". Whatever term you use, make sure you set the search scope to be the entire project.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Hi there,

    You should uninstall the 64 bit MS Office and install the 32 bit version, regardless if your operating system is a 64bit one. See link below for more info:
    https://msdn.microsoft.com/en-us/lib...ffice.14).aspx
    Cheers,
    Vlad

  7. #7
    hemaazez is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Posts
    23
    thanks for all of you . i edit the cod in light of ranman256 comment . it work good Click image for larger version. 

Name:	tsfeeq11.gif 
Views:	11 
Size:	4.8 KB 
ID:	32172Click image for larger version. 

Name:	tsfeeq11.gif 
Views:	11 
Size:	4.8 KB 
ID:	32172

Please reply to this thread with any new information or opinions.

Similar Threads

  1. OnAction attribute error in RibbonXML
    By needtechhelp in forum Programming
    Replies: 2
    Last Post: 10-20-2013, 01:21 PM
  2. Manually changing attribute
    By michaeljohnh in forum Programming
    Replies: 4
    Last Post: 09-14-2010, 12:50 PM
  3. How to access the description attribute
    By joethall in forum Access
    Replies: 1
    Last Post: 06-08-2010, 03:05 PM
  4. Replies: 5
    Last Post: 05-05-2010, 04:31 PM
  5. Unnhide Attribute?
    By thorsonb in forum Access
    Replies: 1
    Last Post: 03-30-2010, 10:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums