Results 1 to 10 of 10
  1. #1
    Anugerah is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jan 2018
    Posts
    15

    Run Time Error 3075 Missing Operator in Query Expression

    I'm adding feature to my form. So if user input WO ID, the related fillings will be filled automatically.


    First I'm trying to autofill the location.

    On picture 1 if I choose ID 476 the location will be "CGK" as shown in picture 2.

    The problem happen when I delete WO ID field then I tried to move to the next field.
    There will be run time error asking to debug it as shown in picture 3.

    Picture 4 is the code I'm using. The code works well if there is value in WO ID field.

    Your suggestions would be appreciated...


    (VBA Code)

    Private Sub WO_ID_AfterUpdate()




    Location = DLookup("[WO Location]", "[WO Query Inv No]", "ID =" & Forms![Equipment Maintenance]![WO ID])




    End Sub
    Attached Thumbnails Attached Thumbnails 3.jpg   1.jpg   4.jpg   2.jpg  

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I don't see anything wrong with the expression. Why do you need it? There is a combobox on form to select location.
    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
    Anugerah is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jan 2018
    Posts
    15
    Quote Originally Posted by June7 View Post
    I don't see anything wrong with the expression. Why do you need it? There is a combobox on form to select location.
    Yes you are right. There is combo box for this form.

    But if I could make use of this expression, there will be 4 field to be automatically filled. That way the user can double checked whether he select the correct WO ID or not.

    The expression is working well until if I tried to delete WO ID to blank then I try to move to other field. There will be run time ERROR 3075.
    I could not find what trigger this error.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    The empty control triggers it, as the error shows the expression is incomplete. This would be more efficient:

    http://www.baldyweb.com/Autofill.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Anugerah is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jan 2018
    Posts
    15
    Quote Originally Posted by pbaldy View Post
    The empty control triggers it, as the error shows the expression is incomplete. This would be more efficient:

    http://www.baldyweb.com/Autofill.htm
    I tried change the combo box so it also display location on column no4

    Click image for larger version. 

Name:	1.jpg 
Views:	17 
Size:	199.1 KB 
ID:	38958

    I change the code to and try to select 1 of the WO ID hoping the location will automatically change according to selected WO ID. But the following error appeared
    Click image for larger version. 

Name:	2.jpg 
Views:	17 
Size:	184.4 KB 
ID:	38957

    This is the code I'm using
    Click image for larger version. 

Name:	3.jpg 
Views:	17 
Size:	120.2 KB 
ID:	38956

    Any advice what should be changed?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I would use dot rather than bang ("." rather than "!"), as shown in the link. I assume you want the 5th field in the combo's row source? Make sure the column count property of the combo is 5.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Why would you need to save these 4 data? This is duplicating data between tables. Data can be retrieved in query joining tables on WOID.

    Advise not to use spaces in naming convention.
    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.

  8. #8
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    One pic shows 4 columns, so perhaps OP doesn't realize column property is 0 based, thus the 4th column is Column(3).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    Anugerah is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jan 2018
    Posts
    15
    Thank you for all your help.
    Now I managed to make my form better with efficient query.

    Here is my code just in case there is anyone meet the same issue.

    Private Sub WO_ID_AfterUpdate()


    Me.[Location] = Me.[WO ID].Column(2)
    Me.[Customer_Project] = Me.[WO ID].Column(3)
    Me.[Inventory_Number] = Me.[WO ID].Column(6)
    Me.[Code] = Me.[WO ID].Column(5)




    End Sub

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Glad you got it sorted.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Error 3075 Missing Operator in query expression
    By PinkLady50 in forum Access
    Replies: 40
    Last Post: 02-24-2017, 03:33 PM
  2. Replies: 2
    Last Post: 09-10-2014, 11:30 AM
  3. Replies: 3
    Last Post: 03-05-2013, 11:17 AM
  4. Replies: 4
    Last Post: 07-25-2012, 04:01 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