Results 1 to 9 of 9
  1. #1
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776

    combo does not go into table field unless you select it twice?

    NewBusiness - Copy.zip

    Hi all,


    Can someone please tell me why when I select from a combo in my subform (the only combo in subform) I Have to choose twice in succession to get it to go into table?
    db Attached, opens to form with sub form on it.

    Thanks
    dave

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Not yet, but when I selected another category in the main form, it wiped out the combos in the subform?
    Not sure a Requery is required?

    Edit: In fact I am unable to select a second time where the data actually stays in the combo?
    In fact I cannot change a lot of the properties of the subform, control and even in the query source?
    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
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Now have it working?
    Amended query and commented out the current event and Save Record in Dirty event.

    Pretty much hit and miss TBH as the query would not edit correctly anyway?
    Attached Files Attached 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

  4. #4
    d9pierce1 is offline Expert
    Windows 10 Access 2019
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Hi Welshgasman,
    First I want to thank you so much! I do have one question as to what does that Query1 do and where is at in forms?
    I went through it and cannot find it anywhere?
    Thanks
    Dave

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Just a query I created to test the source for the combo when the form was open, as the criteria was the mainform combo. You can delete that without any issues.
    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

  6. #6
    d9pierce1 is offline Expert
    Windows 10 Access 2019
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Again, Thank you very much!
    Dave - Marked as solved!

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Thoroughly test it, as I just commented out what I thought might be affecting it.
    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
    d9pierce1 is offline Expert
    Windows 10 Access 2019
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Hi Welshgasman,
    I went through it all and had to remove the Call Form_Current in the Form_Dirty and had to untick the Requery in current event as
    When I go from record to records it wouldn't update the combo and when i went to previous it would clear out the combo. This all seems to
    work now. Again, Thank you. I believe the big issue was the row source where statement.

  9. #9
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    That is pretty much what I did and just tidied up the query for the combo rowsource?
    FWIW I have never used the Dirty event.

    Also it not recommended to call a form event directly.
    Put the code into a general module and call the code from the current event and anywhere else you need it. You might need to pass the form object when doing that though.
    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

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

Similar Threads

  1. Replies: 2
    Last Post: 02-06-2016, 09:25 PM
  2. Replies: 3
    Last Post: 02-09-2015, 09:06 PM
  3. Replies: 3
    Last Post: 12-14-2013, 12:32 PM
  4. Replies: 4
    Last Post: 08-18-2013, 07:40 PM
  5. Combo box to Select Table to Query
    By RedWolf3x in forum Programming
    Replies: 3
    Last Post: 11-15-2012, 04:31 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