Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Posts
    30

    Unanswered: form data refresh

    I have built a sample database with a form I am having a problem with. I am attaching it to this post in a zip file. The form is called NeededItems, and what I do is create 3 unbound combo boxes to narrow down my options in the ItemID box, so department gives me a list of categories, categories gives me a list of subcategories, and subcategories gives me a list of inventory items. It works great until I close the form and open it again, and even though the record is still there, the ItemsID combo box on the record is empty, giving one the impression that it is blank when it really isnt. I think this is probably something trivial which I dont know and I am pretty close on this one, so if anyone could help me with it I would really appreciate it.
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    I don't have the same version Access, so I could not view the file. But, the jist I got from your message is that when you open the form, all the bound controls show the first record, while the unbound controls are blank.

    Depending on which works better for you, you can do two different things:

    1) Make it so the bound controls are also blank

    2) Make it so the unbound controls contain appropiate data

    #1 is the easier to do. Create an On_Open event that sets the form's filter to something it will never be and set the FilterOn property to true. This will clear the form (make sure your combo boxes are in the header).

    #2 requires a bit more work. Since the unbound controls are unbound, Access will apply the default value when the form opens. You can set the default values to all be something appropiate for the first record, but that's not very reliable since the first record can change. The more reliable method is to get the first record's data and set the combo boxes to appropiate values.

    By the sounds of it, #1 is more appropiate: you open the form, pick a department, then a category, then a subcategory and then see the list of inventory.

    Clear ..... as mud? Hope this helps!
    have fun!

    Todd S.
    click to email


    Independent Development Consultant
    Biz db & reports - SQL, Access, Crystal, Seradex and more
    Small, custom, unique programs - Office, VBA, .NET


    _________________________________________________
    Favorite message from Windows:
    There was an error displaying the previous error message

    Sadly, there was no error number to look up ...

  3. #3
    Join Date
    Jun 2004
    Posts
    30
    Sorry man, I dont know where to begin on what you are saying. It is pretty muddy, I included the example because I thought it would be difficult to explain, and it is, so I dont even know based on your reply if I explained clearly what I am asking.

    1) Make it so the bound controls are also blank
    See this is part of my problem. The bound dropdown box IS blank, where I want to show the data thats there if its in the database ie if its not a new record, but I still need the functionality that I can decrease the number of items in the combo box through the selection of department, category, subcategory. Would anyone who can open the sample database be able to help me? The file is in Access 2000 format. Thanks for your help Tcace, if my further explanation clears things up any more I appreciate your input.

  4. #4
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    ok, from what I can see, you want the 3 combos on top to have the correct data in them so that the combo on the bottom has the correct list when the form is opened.

    An easy and reliable way to do that is to add 3 fields to the NeededItems table and bound the 3 combos on top - there's no reason not to store that data especially since you need it when the form is opened.

    There is no way to "refresh" the unbound controls to show the specific value you need - being unbound, they have no data to refresh.

    By the way, if a user is in an existing record and changes one of the values on top, the list, but not the value, on the bottom will change. This makes it possible for the value on the bottom to be "Not In List" but no event will be triggered. The easiest fix is the clear the value on the bottom when a value on the top changes. The more user-friendly approach is to check to see if the value on the bottom is still valid when the top changes and notify the user if it isn't.

    Have fun
    have fun!

    Todd S.
    click to email


    Independent Development Consultant
    Biz db & reports - SQL, Access, Crystal, Seradex and more
    Small, custom, unique programs - Office, VBA, .NET


    _________________________________________________
    Favorite message from Windows:
    There was an error displaying the previous error message

    Sadly, there was no error number to look up ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •