Results 1 to 4 of 4
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 7 64bit Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618

    Error


    Dlookup("BudgetAmount114","q09BudgetAmounts","CmbEnt_ID114=" & BudgetItem _ & " And MonthNumInBus114a <= " & MonthNumInBus038 _ & " And MonthNumInBus114b >= " & MonthNumInBus038)

    The expression you entered contains invalid syntax. All items in red is in the foreign object. The ones in blue is in the local object.

  2. #2
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Nothing painfully obvious without seeing whatever is behind this expression, but if the blue parts are form/report controls, try wrapping in brackets [ ] especially since the underscore might be interpreted as a line continuation character. I'm also not sure about the use of multiple comparison operators such as >=. I'd also try just one or the other to see if it matters because I think I came across this before but can't recall the outcome.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    If that code is all on one line, remove the blue underscores.
    If you want it on multiple lines, leave the blue underscores but place the cursor on the right of the blue underscores and hit ENTER (2 places).

  4. #4
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    You're probably right. I took them to be part of the names.

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

Similar Threads

  1. Replies: 1
    Last Post: 07-26-2016, 06:34 AM
  2. Replies: 6
    Last Post: 03-17-2016, 02:10 PM
  3. Replies: 3
    Last Post: 01-23-2014, 07:49 AM
  4. Replies: 0
    Last Post: 07-16-2012, 05:42 AM
  5. Replies: 6
    Last Post: 05-30-2012, 12:32 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