Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2002
    Posts
    75

    Unanswered: Combo Box Problem Again

    I have a junction table tblLocation of five fields: LocationID, the next 3 fields comprise PK from tblSection, tblUnit, tblAddress, the fifth fields is EmployeeID – supervisor(a lookup field to tblEmployee). Based on this table I’ve created a query: qryStructure: LocationID, SectionID, UnitID, Location:AddressID, StructureectionName & “ – “ & UnitName, Employee:LastNAme & “, “ & FirstNAme & “ “ & MidInitial & “.”

    This tblLocation is related to tblPosition (PositionID, ClassID……,LocationID…)

    On my form (frmPosition) besides all other controls I have three combos:

    cboLocation:
    ControlSource - LocationID.
    RowSource - qryStructure
    ColumsCount - 6
    BoundColumns – 1
    Column Widths – 0;0;0;1;2;0;

    cboStructure:
    ControlSource - LocationID.
    RowSource - qryStructure
    ColumsCount - 6
    BoundColumns – 1
    Column Widths – 0;0;0;0;2;0;

    cboSupervisor:
    ControlSource - LocationID.
    RowSource - qryStructure
    ColumsCount - 6
    BoundColumns – 1
    Column Widths – 0;0;0;0;0;1.5;

    When I move through the records all works fine. But if I change value in one of those combos the values in the rest two remain unchanged. How can I make them work synchronized - if I change value in one cbo – the values of the others change respectively?

    Probably I should change design of the form? But I need this info displayed separately on the form.

    Thank you in advance.

  2. #2
    Join Date
    Jul 2002
    Posts
    22

    Post

    hi,
    I don’t know how/where you change mentioned values (in the form frmPosition?) and what is the recordset of form frmPosition. Because of that I will have to guess that the problem is that the combos are not updated after you change the values of the records of the underlying tables that are loaded by those combos.

    So here is my guess:

    1. Go to form properties of frmPosition
    2. Write AfterUpdate procedure:
    Private Sub Form_AfterUpdate()
    me.cboLocation.requery
    me.cboStructure.requery
    me.cboSupervisor.requery
    End Sub

    Good luck

Posting Permissions

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