Results 1 to 6 of 6
  1. #1
    markrewel is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    3

    Forms and Autoexc Error

    Hi I have created a access database the form has mutliple dynamic drop down lists.
    When I add a autoexeC to open the form from start up, the form loads ok, when I enter the text fileds this is fine, but as soon as I chosse a drop down list it restets the form, creates an entry on the table and gives me a new form to work with?



    Any advice

    Thanks
    Mark

  2. #2
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,002
    What code is behind form open event, and how are you opening the form from the Autoexec ?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    markrewel is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    3
    Throught Macro - open form --view(form name) conditon Add.

    if it helps their are two drop downs that create the issue, the second of the dropdown is dependant on the first dropdown - its when I click this it clears all data, completes the form and gives me new form. the two dropdown are requeried etc - im at a loss as I have similar sheet that has no issues and more of less identicle and cant identify the issue.

  4. #4
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,002
    Okay so you are opening the form onto a New record.

    So is there some event or macro on the combo's that is then doing that again?
    You can prevent that by adding in something like

    If Me.NewRecord Then Exit Sub

    to stop the code running on a new record.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    markrewel is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    3
    Hi I cant see any untoward macro - the only macro on the event is the Requery -

    For the
    If Me.NewRecord Then Exit Sub - where does this go? form or the combo?

    Thanks
    Mark

  6. #6
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,002
    Are you re-querying the form or the second combo? If you requery the whole form it will force a save, and possibly start the process all over again.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Error - method 'item' of object 'forms' failed
    By onlylonely in forum Programming
    Replies: 2
    Last Post: 03-12-2020, 08:38 PM
  2. Continuous Forms error when trying to add record
    By Bcanfield83 in forum Forms
    Replies: 2
    Last Post: 10-05-2018, 11:00 AM
  3. Error while switching forms
    By Bradex in forum Forms
    Replies: 15
    Last Post: 03-17-2016, 08:14 PM
  4. Handling Error 3101 in Forms
    By draz in forum Forms
    Replies: 3
    Last Post: 08-23-2011, 08:34 AM
  5. Date error on my forms
    By elbob62 in forum Access
    Replies: 1
    Last Post: 12-05-2008, 05:35 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