Results 1 to 8 of 8
  1. #1
    falahsalih is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Posts
    38

    "Unknown" message error while opening a query

    Hi,
    when I open a query whether by double click or command button, the following error appears



    Click image for larger version. 

Name:	Untitled.jpg 
Views:	7 
Size:	9.9 KB 
ID:	16544

    what does it mean ?? this error appears sometimes not always. Can any help please.!!!
    I can't figure out what this error refers to, as long as there no any error description or code.

  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,929
    I have never seen that error.

    Can you open the query in Design View or SQL View?

    Post the SQL statement for analysis.
    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
    falahsalih is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Posts
    38
    Quote Originally Posted by June7 View Post
    I have never seen that error.

    Can you open the query in Design View or SQL View?

    Post the SQL statement for analysis.
    yes, I can open the query in design view

    Sql
    Code:
    SELECT customers.[Costumer Name], order.[Order ID], Last(payments.PYMDate) AS LastOfPYMDate, DateAdd('d',30,[PYMDate]) AS [Planned Payment], Abs(DateAdd('d',30,[PYMDate])-Date()) & " " & "Days" AS [Days Passed]
    FROM (customers INNER JOIN [order] ON customers.CustomerID = order.[Customer ID]) INNER JOIN payments ON order.[Order ID] = payments.[Order ID]
    GROUP BY customers.[Costumer Name], order.[Order ID], DateAdd('d',30,[PYMDate]), Abs(DateAdd('d',30,[PYMDate])-Date()) & " " & "]Days", customers.CustomerID
    HAVING (((DateAdd('d',30,[PYMDate]))<=Date()));

  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,929
    The Abs() expression in the GROUP BY has an extra ] in front of Days.

    There is also an unnecessary concatenation in both of the Abs() expressions but that should not cause error.

    Abs(DateAdd('d',30,[PYMDate])-Date()) & " Days"
    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.

  5. #5
    falahsalih is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Posts
    38
    Quote Originally Posted by June7 View Post
    The Abs() expression in the GROUP BY has an extra ] in front of Days.

    There is also an unnecessary concatenation in both of the Abs() expressions but that should not cause error.

    Abs(DateAdd('d',30,[PYMDate])-Date()) & " Days"
    If there is a syntax or expression error, so why this error disappear sometimes ?

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    That looks like a MsgBox to me. Are you sure you are opening a query object?

  7. #7
    falahsalih is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Posts
    38
    Quote Originally Posted by falahsalih View Post
    If there is a syntax or expression error, so why this error disappear sometimes ?
    Yes, I'm sure. I believe that the problem lies in the query structure, because i'm doing many nested expressions in it.
    Can I re-form the query using sql ?

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I have no idea why the error would be intermittent.

    Maybe use "d" instead 'd'.

    That is SQL.
    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. Suppress "Error" message following "Cancel = True"
    By GraeagleBill in forum Programming
    Replies: 7
    Last Post: 03-23-2014, 05:40 PM
  2. Replies: 2
    Last Post: 11-12-2013, 07:06 PM
  3. Replies: 22
    Last Post: 10-10-2013, 12:47 PM
  4. Replies: 11
    Last Post: 11-26-2010, 10:53 PM
  5. Replies: 8
    Last Post: 11-12-2010, 10:55 AM

Tags for this Thread

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