Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    The Hague, Netherlands

    Unanswered: Make fields connected

    Another one: I have a few txfields/combo-boxes, together showing info about offices. The main table, connecting the data, is arranged around the wall-outlets in the office, because this was (concerning tables) the best construction (one outlet connects PC/roomnumber/user etc).

    However, as you might understand, for the user, I'd like to be able to select/search on roomnumber and names. But when I change that through the dropdown-box, the data gets updated, thats not what I want. I want that I can select 'office D346' and then the rest of the fields show the data belonging to office D346 (say outlet BB016, 17"monitor etc) but that this is also possible the other way around.

    Optimally, I'd like the user to be able to type or select a room or user and all corresponding data instantly appears on screen in the other fields.

    I realize there is a problem with the one-to-many-relationships my tables have, but even if I had one-to-one tables, would a thing like this be easy or would it need some coding? (which could still be easy but ok )

  2. #2
    Join Date
    Aug 2002
    Northampton, England
    You want an unbound combo box. In the after event procedure put code something like this.

    Private Sub cboName_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[PrimaryKey] = '" & Me![cboName] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark

    End Sub

    You can create this code with the wizard.

Posting Permissions

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