Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2010
    Posts
    36

    Unanswered: Cutom data entry form in ms access

    hi all;

    i need a data entry form in ms access with the following scenario

    i have a long table like the following:

    1. Disease A for U5male
    2. Diseas B for U5male
    3. Disease C for u5male
    4. Disease D for U5male
    5. Disease E for U5male
    5. Disease A for U5female
    6. Diseas B for U5female
    8. Disease C for U5female
    9. Disease D for U5female
    10. Disease E for U5female
    ...
    it continues for over 5 male and female and for a number of other disease.
    the table has totally 316 records.

    what i want is to create a form like the following for the above table using vba


    Disease U5Male UFemale O5Male O5Female
    A 6 7 5 0
    B 1 7 4 6
    C 6 3 2 9
    D 5 7 2 10
    E 11 2 4 5
    .
    .
    .
    N

    any hand is appreciated.

    thanks

  2. #2
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    This is a poor database design that will give you more problems than just this one with the required output form.

    You need to break it into three tables - one for animals, one for diseases and one to record which animals had which diseases. You can then put the three together in a cross-tab query that will output the results that you need.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  3. #3
    Join Date
    Dec 2010
    Posts
    36
    My friend

    can you give a live example.

    thanks

  4. #4
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    Create a table to hold animal information (ID field [primary key], name, any other details that you need to keep). Create another table to hold disease information (ID field [primary key], name, any other details that you need to keep [possibly not treatments - that should go in a different table, but we can come back to that]). Then create a table to hold information on which animals have had which diseases (animal PK, disease PK, infection date, all of which form the primary key).

    Once you have data about animals, diseases and when the former contracted the latter, you can use all three tables to build a cross-tab query (see Access' help file for more information on them) that has disease IDs/names as row headers, animal IDs/names as column headers and counts how many infections there were for each.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Posting Permissions

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