Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2017
    Posts
    1

    Unanswered: create a log for each entry/row - listbox with data?

    Hi

    Im new to access and trying to learn things.

    I have created two tables and a relationship between them.
    I have created a form with a listbox where i want to display data from one table based on the connection to the first table.

    Table 1: Staff_Profiles
    contains names, adress etc.

    Table 2: Log_Data
    contains dates and some other fields

    In my form i have a listbox where i want the data from Log_data to be displayed
    But i cant get it to work... dont know what i am missing.

    I have uploaded my file here.
    Hope someone can help me!
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    630
    Provided Answers: 34
    the form should be a parent/child form.
    the parent form should be 1 record of Staff_profiles
    the child form should be many records (or datasheet) of Log_data
    the subform control property (in parent) should link:
    LINK MASTER FIELDS: staffID
    LINK CHILD FIELDS: staffID

    the list box should show all Staff members.
    the list box should have 2 columns, STAFFID, NAME
    the list box is bound to col 1
    HIDE col1 so users dont see it, it is not needed for users. COLWIDTHS = 0;2 (zero to hide ID, 2 to show Name)

    when user clicks on an item in the list, filter the PARENT form. this will then show all the Log data in the subform:

    Code:
    sub lstBox_afterupdate()
      me.filter = "[staffID]=" & lstBox
      me.filterOn = true
    end sub

Posting Permissions

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