Results 1 to 7 of 7
  1. #1
    CRobledo is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    26

    I am getting this error message please help

    I'm getting this error message on a form I'm making. Syntax error (missing operator ) in query expression SELECT Sum( [Orchardinfo]![Acres] ) WHERE [Orchardinfo]![UnboundOrchard] = [Workorder Input]![Grower] AND [Orchardinfo]![UnboundBlock] IN [Workorder Input]![Block2]

    does anyone see anything I did wrong?



  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    I'm no expert on sql but thought in had to be followed by a list.


    Sent from my iPhone using Tapatalk

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    There's also no FROM clause in what's shown. More detail might help; the full SQL or code.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    CRobledo is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    26
    I made a form with a combo box that stores multiple values and those values are the names of small pieces of land in a large property(orchards). It gets those names from a table call Orchardinfo. What I would like it to do is sum the acres for each land to give me a total acres selected. Click image for larger version. 

Name:	block.PNG 
Views:	11 
Size:	97.6 KB 
ID:	27741

    here is the table it looks at Click image for larger version. 

Name:	Orchardinfo.PNG 
Views:	11 
Size:	47.4 KB 
ID:	27742 and at the end I want it to store the data in a table called work order input which is the control source for the form.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If Block is a multi-value field, I'm not sure how to use it. I haven't and won't use one. I don't think it does what you think, but if you want to attach the db here I can play with it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    CRobledo is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    26
    https://www.dropbox.com/sh/9olwhaonr...L28ZnJQya?dl=0

    I could not find how to do an attachment so I just did a link

    thank you so much! I've been trying to figure this out for days
    the pop up form that opens when you first open the DB you can right click and close.

  7. #7
    NTC is offline VIP
    Windows 10 Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    Sorry I do not open attachments. Generic advice: do not rely on the form's fields for the math you seek. The form is the presentation level and while sometimes is suitable to provide the input to math - not always - and in your case because block is multi value and acres further splits block into sub values you need to address your math at the query level. Then at the form level do a DLookUp of the query result.

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: 7
    Last Post: 03-17-2016, 05:53 PM
  3. Replies: 5
    Last Post: 05-15-2015, 10:49 AM
  4. Replies: 15
    Last Post: 11-01-2013, 03:24 PM
  5. Replies: 7
    Last Post: 07-24-2013, 02:01 PM

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