Results 1 to 4 of 4
  1. #1
    ashraf_al_ani is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Aug 2014
    Posts
    6

    error with a code


    Dear all
    I am using access front end and sql server back end (access project)

    this code

    1. Me.INV_DATE =Date
    2. Previous_Date=DCount("*","Invoice","[INV_Date]=#"&Me.INV_DATE &"#")
    3. IfPrevious_Date=0Then
    4. Me.NUM1 = 1
    5. Else
    6. 'existing in the table
    7. Me.NUM1 =DMax("[NUM1]","INVOICE","[INV_Date]=#"&Me.INV_DATE &"#")+1
    8. EndIf


    this code runs ok in access .mdb
    but when i take it in access form in access project .adp

    error appears in

    in this statement

    1. Previous_Date=DCount("*","Invoice","[INV_Date]=#"&Me.INV_DATE &"#")

    please any idea

    best regards

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    What is the exact error message?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ashraf_al_ani is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Aug 2014
    Posts
    6
    run-time error '-2147217855(80040e-41)':
    command contained one or more errors

    this is the error message
    pls any ideas
    best regards

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    Your code is missing some spaces, words are running together. Is that just poor typing in post? Why don't you copy/paste the code from the VBA window to the post?

    I have never used adp. No idea why the code would fail. That error message is not very informative.

    Bing: domain aggregate in adp
    http://www.tech-archive.net/Archive/.../msg00170.html

    Apparently others have experienced this issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. VBA Code Returning Error Run Time Error 3061
    By tgwacker in forum Access
    Replies: 2
    Last Post: 11-24-2013, 11:00 AM
  2. Code Error - Can you have too many expressions?
    By aaron.irvine in forum Access
    Replies: 19
    Last Post: 10-29-2013, 08:05 PM
  3. Error message code
    By FJM in forum Access
    Replies: 11
    Last Post: 09-09-2013, 04:42 AM
  4. Error in form code
    By devesa in forum Access
    Replies: 3
    Last Post: 05-25-2010, 10:15 AM
  5. Error in Code
    By Lockrin in forum Programming
    Replies: 3
    Last Post: 02-25-2010, 03:27 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