Results 1 to 10 of 10
  1. #1
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136

    Run-time error all of a sudden

    Hi,
    I have a form that is giving me a run-time error after making a small change. It's an Access form with a SQL backend. The form is a single form with a subform (one to many relationship). I use an unbound box in the main form to select a product and requery the subform which gives me multiple hits.

    Literally all I did was add a new field to the table in SQL, refresh the table link in Access, add the new field to the subform and save it. Now when I open the main form and select a product I get this error:



    I didn't touch the VB script at all. When I click Debug it highlights the subform. Any idea why I'm receiving this?




  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    You are not showing anything.
    You cannot copy and paste images on this site, you need to attach them as files.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    windows & office can run updates and mess with internal references.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Open just the subform, does it work with no errors and do you see the new field in that form? Add some data to the tables so you can see it in the subform. This could tell you if there is an issue with the subform or not.

    Need to see the error

  5. #5
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136
    Quote Originally Posted by Welshgasman View Post
    You are not showing anything.
    You cannot copy and paste images on this site, you need to attach them as files.
    Can you see the attachments now?
    Attached Thumbnails Attached Thumbnails Screenshot 2024-03-19 152027.png   Screenshot 2024-03-19 152058.png  

  6. #6
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136
    Quote Originally Posted by Bulzie View Post
    Open just the subform, does it work with no errors and do you see the new field in that form? Add some data to the tables so you can see it in the subform. This could tell you if there is an issue with the subform or not.

    Need to see the error
    The subform is fine. It's definitely something with the main form. It's just weird because I didn't change anything in the main form.

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    That is the subform control name?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  8. #8
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136
    Quote Originally Posted by Welshgasman View Post
    That is the subform control name?
    It is. I can click End or Debug and go on about my business and everything works fine. It only happens when I first open the form.

  9. #9
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    It only happens when I first open the form.
    Do you have option explicit declared?
    does the code compile?

    Any code in the open or current events?
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  10. #10
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Maybe try full path of subform? (adjust syntax)
    Forms![mfrmxxx]![sfrm_Supplemental_Distributor_Products].Requery

    Could also look to use Linkchild, Linkmaster on subform Data properties to link the subform, then you would not need to do the requery on the subform.

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

Similar Threads

  1. Replies: 8
    Last Post: 01-19-2023, 09:07 AM
  2. Sudden occurences of 3027 runtime error
    By GraeagleBill in forum Programming
    Replies: 2
    Last Post: 03-29-2021, 05:04 PM
  3. Replies: 8
    Last Post: 05-16-2016, 08:17 AM
  4. Error 2105 all of a sudden
    By TaliaKlein in forum Forms
    Replies: 7
    Last Post: 11-09-2015, 10:47 AM
  5. Button to open form sudden error
    By tgunarto in forum Macros
    Replies: 2
    Last Post: 11-21-2014, 01:04 AM

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