Results 1 to 11 of 11
  1. #1
    krackout is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Posts
    4

    how to enter multiple values to field

    I need to store same samples (numbers) in a period of time, in an MS Access database. The samples could be 10 or 20 or 30 or more in the given period of time. So it's not practical to have 30 fields to fill in values and leave empty the ones not needed; lots of them, plus there could be even more samples on occasion.
    The values are not fixed, so I cannot use a multivalued field. I need to enter arbitrary, multiple values to the same field. Also I'd like them to be highlighted with conditional formatting - which is easily done on a standard number field. Any ideas how to achieve this? Other ways are welcomed, I need the result, don't care about the way it's accomplished.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,906
    You are correct, except for the fact you should have as many records as you have samples, not fields. Get your Excel head off, databases work differently.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Can you upload your current database so we can see your table structure?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  4. #4
    krackout is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Posts
    4
    I can upload it, yes. Don't know if it's possible directly over here or using a link. Nevertheless,
    Consider it a simple excel like table:
    -------------------------------
    surname|name|sample metering|
    -------------------------------
    Some | One | 1.3 |
    -------------------------------

    The problem is that the sample meterings are not fixed or known beforehand. Could be 10 or 40, or whatever.

  5. #5
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Look at the Link above "How to attach files"

    It would also help if you can explain the purpose of the database.

    Your 1 Table indicates that it will not be Normalised.

    I take it that 1 Person will have many Samples
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,778
    Only once in all my years of dabbling in Access did it ever seem it necessary to do this and that case was all about data entry. I used a csv field but it required code to build a csv string as well as to separate it when needed. It's more likely that you are not thinking in terms of proper db design because when data is in rows and not columns, the number of data points or records in this situation doesn't matter.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Join Date
    Apr 2017
    Posts
    1,679
    Quote Originally Posted by krackout View Post
    Consider it a simple excel like table:
    surname|name|sample metering|
    It looks like you need at least 3 tables. Like:
    tblPersons: PersonID, Surname, Name
    tblSamples: SampleID, SampleInfo, ...;
    tblSampleMetering: SampleMeteringID, SampleID, PersonID, ..., MeasuredValue.

    Probably you need a form where you can register persons (unless you prefer to enter them directly into table, and don't want to add new persons from your app).
    Definitely you need a form where you register samples (preferably a single form, so it will be easier to add a linked subform to it).
    And then you need a continuous form for sample metering, which you add to samples form as subform, and link them through SampleID.

    Adding person info depends on how is the work with samples organized. When always a single person makes all meterings of given sample, you can add PersonID field to tblSamples, and link sample and metering forms through PersonID too. When several people may meter same sample, you add PersonID into tblSampleMetering, and register the person there.

  8. #8
    krackout is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Posts
    4
    Quote Originally Posted by mike60smart View Post
    Look at the Link above "How to attach files"

    It would also help if you can explain the purpose of the database.

    Your 1 Table indicates that it will not be Normalised.

    I take it that 1 Person will have many Samples
    It's a simple db to store patients' blood sugar readings. But the doctor may ask for more or less sampling, depending on case.
    Yes, a person may have many samples, but how many, is not known beforehand.

  9. #9
    Join Date
    Apr 2017
    Posts
    1,679
    In case only one measuring is done per sample, there will no need for tblSampleMetering - simply add a field for result into tblSamples, ant it's all!

  10. #10
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,778
    Don't know if it matters or would help, but aren't these readings measured on a per test basis? When you talk of blood samples it makes me think of running several tests on one sample, which is certainly more than just pricking a finger (no idea if that's still how it's done) to conduct one test. In that case I only see the need for one patient table and one test table as well - unless you bring other things into this such as testing devices, testing locations, doctor names and such.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    krackout is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Posts
    4
    Quote Originally Posted by ArviLaanemets View Post
    It looks like you need at least 3 tables. Like:
    tblPersons: PersonID, Surname, Name
    tblSamples: SampleID, SampleInfo, ...;
    tblSampleMetering: SampleMeteringID, SampleID, PersonID, ..., MeasuredValue.

    Probably you need a form where you can register persons (unless you prefer to enter them directly into table, and don't want to add new persons from your app).
    Definitely you need a form where you register samples (preferably a single form, so it will be easier to add a linked subform to it).
    And then you need a continuous form for sample metering, which you add to samples form as subform, and link them through SampleID.

    Adding person info depends on how is the work with samples organized. When always a single person makes all meterings of given sample, you can add PersonID field to tblSamples, and link sample and metering forms through PersonID too. When several people may meter same sample, you add PersonID into tblSampleMetering, and register the person there.
    Ok, got it! I made a new table, linked to Samples. I also made forms for both tables, form and sub form, in table like view - in order to add records. It's a bit rough at the moment, it seems to me quite difficult to design the form, but given time, I'll straight up everything

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 05-14-2018, 06:05 PM
  2. Replies: 2
    Last Post: 05-17-2017, 06:17 AM
  3. Replies: 3
    Last Post: 05-15-2017, 06:33 PM
  4. Form to enter multiple values at same time
    By sukhjinder in forum Forms
    Replies: 4
    Last Post: 01-24-2017, 02:49 AM
  5. Replacing many values at once in a multiple values checkbox field.
    By ConfusedDatabaseDesigner in forum Forms
    Replies: 2
    Last Post: 07-20-2012, 08:58 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums