Results 1 to 10 of 10
  1. #1
    yes sir is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    159

    Combo boxes stop working properly upon reopen of DB

    I am a little confused as to why this keeps happening, but every time I close my database and the reopen it, the combo boxes on my form don't work.

    Here are a couple of things to know. This form opens when the database opens. The combo boxes are used to filter other forms and reports, so I have some code that filters based on the selection and click of a button.

    Here is what I have going on:
    Form name: Open
    Combo Box: Position
    Where as condition for filter: [Primary Pos]=[Forms]![Open]![Position]

    Query name: Top 10
    Primary Pos criteria: [Forms]![Open]![Position]

    Report name: Top 10
    Filter: [Primary Pos]=[Forms]![Open]![Position]
    Filter on Load: Yes

    Once reopened and I select a Position and then hit the command button, I get a Enter Parameter message box that says: Forms!Open!Position with a blank white input box.

    The only thing I have been able to do to fix the issue is to keep changing everything from Position to Positions. Overall, I am completely blank when it comes to finding a permanent solution.



    Any help would be great. Thanks

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    Is the Position ComboBox bound to a field in the RecordSource of the Form? If not then I think you will find it has no value when first opened. You could verify this by setting an extra TextBox ControlSource on the form to: =Me.Position and see what you get.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  3. #3
    yes sir is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    159
    Quote Originally Posted by RuralGuy View Post
    Is the Position ComboBox bound to a field in the RecordSource of the Form? If not then I think you will find it has no value when first opened. You could verify this by setting an extra TextBox ControlSource on the form to: =Me.Position and see what you get.
    Thanks for the reply and I'm not quite sure but I don't think the position combobox is bound to a field in the record source. I have five values (PG, SG, SF, PF, and C) that can be selected in the combobox, based on the value selected it filters the reports. So if 'PF' is selected, then only the records with the Primary Pos = PF will show.

  4. #4
    yes sir is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    159
    I feel like I never do a good job explaining, so I have attached a sample of the file.

    However, the command buttons are working on the sample. I think my own original database is getting too confused with the code, maybe there is too much going on at once. I don't know.

    Anyways, if you open up the file I attached. The Open form will display. At the bottom you will see Top 10 Report, Top 20 Report, and Best of the Rest. Upon the selection that is made in the combobox directly above it filters the reports accordingly. Feel free to look at the code in my queries for the corresponding reports and the command buttons on the Open form. Maybe I need to do a better job with my coding.

    Not really sure why it works on this sample, but not on the bigger file.

  5. #5
    yes sir is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    159
    I just compared the queries and report filter code for both the sample database (which works) and my original database and everything is exactly the same.

  6. #6
    yes sir is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    159
    GRRRRRRR!!!

    Now my original database's comboboxes are working and I swear I did nothing different to fix it as I did the other times when I was temporarily fixing it.

    This is making no sense at all.

  7. #7
    yes sir is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    159
    Sorry for continuing to post, but I am completely confused and dumbfounded as to why it is suddenly working.

    The only that changed is this:
    Report name: Top 10
    Filter: [Primary Pos]=[Forms]![Open]![Position]
    Filter on Load: Yes

    to this:
    Report name: Top 10
    Filter: [Primary Pos]=Forms!Open![Position]
    Filter on Load: Yes
    But the filter code had been changing on its own in all my previous attempts/temporary fixes as well.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    Could you be dealing with some corruption? I would try *importing* everything into a fresh new db and see if the problem follows. http://www.btabdevelopment.com/ts/impnew
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  9. #9
    yes sir is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    159
    Quote Originally Posted by RuralGuy View Post
    Could you be dealing with some corruption? I would try *importing* everything into a fresh new db and see if the problem follows. http://www.btabdevelopment.com/ts/impnew
    I'm sure that may have been the problem. I just opened and closed and reopened the database and it is working fine. I'll play on the safe side and import into a new database.

    Thanks Ruralguy

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    And don't forget to turn OFF Name AutoCorrect and then do a Compact and Repair.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

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

Similar Threads

  1. Replies: 0
    Last Post: 12-20-2010, 12:35 PM
  2. Replies: 1
    Last Post: 12-02-2010, 11:08 PM
  3. Delete SQL statement not working properly
    By Alexandre Cote in forum Programming
    Replies: 3
    Last Post: 10-18-2010, 12:56 PM
  4. Replies: 2
    Last Post: 11-29-2009, 12:00 PM
  5. Query on chart not working properly!
    By Sim_ in forum Queries
    Replies: 0
    Last Post: 10-28-2009, 09:38 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