Results 1 to 5 of 5
  1. #1
    sitedataview is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    2

    Question Help with Subforms containing listbox's and filtering listbox data


    I have a main form called frmEstimate with a detail sub form called frmEstimateDetails. The main form contains record info while the sub form contains record details (so 1 main record to many detail rows). I have 3 combo boxes on the sub form datasheet view cboWorkType, cboWorkDepartment and cboWorkCategory. I'd like to populate cboWorkDepartment based on the selection of cboWorkType and populate cboWorkCategory based on the selections of both cboWorkType and cboWorkDepartment. Once I have selected values in all 3 dropdowns, I'd like to autopopulate a txt box called txtBaseRate with the corresponding value from the table. So basically I'm generating the "Where" clause in a sql statement on each control for the data that drops down. I also do a requery on the AfterUpdate on each as well. Now when I create this on a standalone form it works great and I'm using "where WorkType = forms!frmEstimateDetails!cboWorkType" however since it's a sub form this logic isn't working and just keeps prompting me. Can anyone please help me with the syntax to get this to work I'm stumped!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Remove the form prefix. Just reference the combobox name.

    Be aware that if these comboboxes are multi-column with lookup alias, they won't work nice in Continuous or Datasheet view form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    when you call a value via syntax Forms!FormName.ControlName - - that call is just 1 name and if it is being applied to a continuous form type - that control is appearing over and over in each row.....so that's why it can't work

    off the top of my head I'm not sure you can do cascading comboboxes in a continuous form - - but if it can be done it might be by dropping the syntax to just ControlName within the query that serves as the record source of the combobox control...it cannot be a stand alone query object from the navigation pane - it would need to be the record source of the control - - perhaps it will fire from within its own row data...

  4. #4
    sitedataview is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    2
    NTC - I'm not sure, I would think I could it seems so simple. I just want to narrow down the list data so it finally selects the final base rate. I'm just building a where clause - I can do it with a sql statement but not build it on the form. I guess I could get over it with the 3 drop downs and switch to a single dropdown showing 3 columns but that is still the same issue when I want to populate the base rate. So it would be select row 1 showing A, B, C to populate Base Rate. I think there is a trick to doing it within a subform. I've see a bunch of posts but just can't get the right syntax to work.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Did you see post 2?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. (SOLVED) Need help on Filtering listbox
    By jinro in forum Access
    Replies: 6
    Last Post: 08-22-2014, 10:45 PM
  2. Replies: 2
    Last Post: 03-23-2014, 06:50 AM
  3. Replies: 15
    Last Post: 10-01-2013, 09:31 PM
  4. Replies: 3
    Last Post: 12-13-2012, 04:40 AM
  5. Replies: 1
    Last Post: 09-10-2012, 11:21 PM

Tags for this Thread

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