Results 1 to 4 of 4
  1. #1
    benjammin is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Nov 2010
    Posts
    60

    table lookup / null field values, help!

    Hello!

    So i have a cascading combo box with 3 choices, Site, Location and Station, this is for an inventory db.



    Equipment ALWAYS is attached to a Site, sometimes to a station and occasionally to a Location. The subform is based off of the Station combo box using a macro (better to use vba?). However, if a user chooses a Site that has no Station or Location attached to it, how do I tell the macro to update the subform?! Does this make sense? Could I do an afterupdate and run some sql that will lookup the row associated with the Site and see that there is no LocationID or StationID and then run something to update the subform?

    Seems a little cumbersome but instead of the cascading combo boxes i guess I could make Site a subform, Location a sub-subform and Station a sub-sub-subform with their own combo boxes...

    Hopefully this isn't too ambiguous. Thanks.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    So you want to refresh the contents of a subform based on the main form? If your main form/subform are linked correctly you shouldn't have to force a refresh at all. Or are you saying you want the contents (visible fields) to change based on the user selected items in your combo boxes?

  3. #3
    benjammin is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Nov 2010
    Posts
    60
    Well the subform is based on the mainform and DOES refresh when I update my combo box that is linked (stationID). My cascading combo boxes go in order: Site, Location, Station. The problem is that some sites have equipment not attached to any station and location.

    I was thinking maybe the easiest way would be to just make another form, one form edits ALL hardware at a site and another form edits only hardware attached to the station.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I would think you could set up the query driving your subform to properly exclude or include items based on your combo box selections. The worst case is you could set up a secondary subform that looks only at equipment that is related to site only, or equipment where locationID is null and station is null but still matches the siteID

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

Similar Threads

  1. Replies: 6
    Last Post: 03-22-2011, 08:22 PM
  2. Replies: 3
    Last Post: 01-15-2011, 02:39 AM
  3. Use a lookup field to influence values in another field
    By nathanrt in forum Database Design
    Replies: 3
    Last Post: 01-13-2011, 03:40 PM
  4. null values
    By ippy in forum Queries
    Replies: 3
    Last Post: 12-20-2010, 10:39 AM
  5. Excluding null values on SQL table query
    By DB2010MN26 in forum Queries
    Replies: 1
    Last Post: 09-03-2010, 12:54 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