Autofill problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • StuckAndNoClue
    New Member
    • Nov 2006
    • 11

    #1

    Autofill problem

    I've searched through some of the answers on the forum regarding autofill but I can't work out how to do it for my database.

    I have two tables
    1. Members info, containing the following fields:
    a. Member ID (primary)
    b. Division that the member belongs in
    c. Address
    d. Names

    2. Division Night info containing the following fields:
    a. Which Division is holding training night (
    b. Members who attended (Member ID) as a combo box
    c. Visitor or Member of the specific Division

    One-To-Many relationship is set up between 1a and 2b

    My question is how do i set up the database on the form so that when i select 2a and 2b, then 2c automatically comes up?

    2c is worked out by looking at the member ID in 1a and if the division that the member belongs to (1b) is the same as the division holding the training night (2a), then 2c's answer is a 'Member'?

    Thanks
  • StuckAndNoClue
    New Member
    • Nov 2006
    • 11

    #2
    I know it has something to do with Dlookup but i dont know how to use the function.

    Comment

    • StuckAndNoClue
      New Member
      • Nov 2006
      • 11

      #3
      I have two tables with the following field names
      1. Members info, containing the following fields (tbl01MembersDe tail):
      a. Member ID (primary) - lngMemberNum
      b. Division that the member belongs in - strDivisionName
      c. Address
      d. Names

      2. Division Night info containing the following fields:
      a. Which Division is holding training night
      b. Members who attended (Member ID) as a combo box - LngMemberID
      c. Visitor or Member of the specific Division

      In 2b's combo box after-update feature, i've added this code:
      test = DLookup ([strDivisionName], "tbl01MembersDe tail",[lngMemberNum] = LngMemberID)

      I just used "test" to see if the result gives me the division that the member belongs to, which i can then compare and determine whether the member is a visitor to the division holding the training night.

      Sorry if it's all very confusing, it is like that for me.

      Comment

      • StuckAndNoClue
        New Member
        • Nov 2006
        • 11

        #4
        Originally posted by StuckAndNoClue
        I have two tables with the following field names
        1. Members info, containing the following fields (tbl01MembersDe tail):
        a. Member ID (primary) - lngMemberNum
        b. Division that the member belongs in - strDivisionName
        c. Address
        d. Names

        2. Division Night info containing the following fields:
        a. Which Division is holding training night
        b. Members who attended (Member ID) as a combo box - LngMemberID
        c. Visitor or Member of the specific Division

        In 2b's combo box after-update feature, i've added this code:
        test = DLookup ([strDivisionName], "tbl01MembersDe tail",[lngMemberNum] = LngMemberID)

        I just used "test" to see if the result gives me the division that the member belongs to, which i can then compare and determine whether the member is a visitor to the division holding the training night.

        Sorry if it's all very confusing, it is like that for me.
        FOUND THE ANSWER, I HAD THE QUOTATION MARKS IN THE WRONG PLACE!

        Comment

        Working...