Results 1 to 3 of 3
  1. #1
    motogbbj is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Location
    NL-Overijssel
    Posts
    11

    Unhappy combobox on continuous form does not show values pending from other combobox


    I have a continous form with two comboboxes and a few textboxes. I ám not able to show the values in the second combobox, pending on the content in the first Combobox.
    If i use the same VBA for the same comboboxes but on single form, it works properly.
    Can any one help met the cause of this or with a solution for this ?

    Many thanks in advance .

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Every time you change cbo1, you must update cbo2 data.
    Code:
    sub cbo1_afterupdate()
      cbo2.requery
    end sub
    this works IF cbo1 is referenced in cbo2's SQL
    cbo2 SQL= select * from table where [field]= forms!myForm!cbo1

  3. #3
    motogbbj is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Location
    NL-Overijssel
    Posts
    11
    Quote Originally Posted by ranman256 View Post
    Every time you change cbo1, you must update cbo2 data.
    Code:
    sub cbo1_afterupdate()
      cbo2.requery
    end sub
    this works IF cbo1 is referenced in cbo2's SQL
    cbo2 SQL= select * from table where [field]= forms!myForm!cbo1

    My target is having the possibility of selecting a room in the second combo box, pending on the chosen building in the first combo box. I can get it working on a single form, but not on a continuous form.

    It is almost good working now on the continuous form: I can choose in the second combo now the right options, BUT in the other records on the continuous form, ALL the other second combo boxes get empty which records have another value in the first combo…

    If I change the content of the first combo in another record on the form, all records with the same value in the first combo show the right content in the second combo, but of the records with another value in the first combo, the second combo gets empty.
    I do requery the second combo after update of the first one.

    This the SQL as source for the second combo:

    SELECT TBL_LOCATION_ROOM.[ID-ROOM], TBL_LOCATION_ROOM.Room_nr, TBL_LOCATION_ROOM.Room_name, TBL_LOCATION_ROOM.Building FROM TBL_LOCATION RIGHT JOIN TBL_LOCATION_ROOM ON TBL_LOCATION.[ID-LOCATION] = TBL_LOCATION_ROOM.Building WHERE (((TBL_LOCATION_ROOM.Building)=[Formulieren]![FRM_PROJDATA_PROJAPPARATEN]![SUBFRM_PROJ_APPARATEN].[Form]![Location])) ORDER BY TBL_LOCATION_ROOM.Room_nr, TBL_LOCATION_ROOM.Room_name;.

    I don’t understand it anymore, after spending hours of working on it. Can anyone help me out of this issue ?
    Many thanks in advance for your help. John.

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

Similar Threads

  1. Replies: 3
    Last Post: 03-02-2016, 06:05 PM
  2. ComboBox to Populate Continuous Form
    By Elwood07 in forum Forms
    Replies: 1
    Last Post: 12-10-2015, 10:26 PM
  3. Replies: 8
    Last Post: 06-12-2014, 05:25 AM
  4. Replies: 5
    Last Post: 05-17-2013, 10:45 AM
  5. Combobox to show two field values
    By lnordstrom in forum Forms
    Replies: 2
    Last Post: 03-30-2011, 12:33 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