Results 1 to 4 of 4
  1. #1
    jimmy2x2x is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    2

    Simple problem from a newbie user

    Hello, I am just starting out with access and could use a pointer or two for this problem.

    I have a database of people with various personal information, one part of the data to be stored Heights and Weights. These need to be recorded on a monthly basis.

    The solution I had in mind was to have a table laid out as follows:

    Weight: Table

    ID: AutoNumber 'Unique identifier
    WeightID: Number 'Reference back to the persons unique identifier
    WeightType: Number 'Height or Weight
    WeightValue: Number 'The actual Weight or Height
    WeightDate: date/time 'Date the entry was recorded

    The problem is how do I store this information in the table?

    For example, I enter the data into a form, then click a button and I want to add a new record to this table, filling all the records fields.

    Sorry for the newbie question!

  2. #2
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by jimmy2x2x View Post
    Hello, I am just starting out with access and could use a pointer or two for this problem.

    I have a database of people with various personal information, one part of the data to be stored Heights and Weights. These need to be recorded on a monthly basis.

    The solution I had in mind was to have a table laid out as follows:

    Weight: Table

    ID: AutoNumber 'Unique identifier
    WeightID: Number 'Reference back to the persons unique identifier
    WeightType: Number 'Height or Weight
    WeightValue: Number 'The actual Weight or Height
    WeightDate: date/time 'Date the entry was recorded

    The problem is how do I store this information in the table?

    For example, I enter the data into a form, then click a button and I want to add a new record to this table, filling all the records fields.

    Sorry for the newbie question!
    I would do a main/sub form set up. Create a main form based on the persons main info such as name, address, dob, etc. Create the subform based on the weight table. I prefer to use a continuous form format for the subform. Insert the subform into the main and link the form, parent/child, link via the Person's unique ID and the foreign key for the weight table, WeightID.

  3. #3
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    You probably need to split your data into two tables.

    The first table includes people and their identifiers, e.g. employee number, phone number, address.... The second table includes the linking identifier, e.g. employee number, and date, weight and anything else that is date and person related.
    Establish the table relationships, i.e. for each identifier in the first table, you may have many in the second table.
    You may want to use a main form to fill in the people and identifiers, and a subform to fill in the date related info.




    Please use the thread tools to mark as solved when your question is answered.

  4. #4
    jimmy2x2x is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    2
    Thanks for your kind replies, I have solved the problem in the desired way with this code.


    Set MyRS = CurrentDb.OpenRecordset("Weight")
    MyRS.AddNew
    MyRS("WeightID").Value = Me![ID]
    MyRS("WeightType").Value = "Height"
    MyRS("WeightValue").Value = Me![HeightBox]
    MyRS("WeightDate").Value = Me![HeightDateBox]
    MyRS.Update
    Me![HeightBox] = ""
    Me![HeightDateBox] = ""
    MsgBox "Height Added", , "Operation Complete"

    Need to add some parsing checking and its all done.

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

Similar Threads

  1. Newbie problem with report!
    By BillyAckers in forum Database Design
    Replies: 2
    Last Post: 03-23-2011, 02:27 AM
  2. Newbie, seems simple to lookup value?!
    By ayce123 in forum Queries
    Replies: 3
    Last Post: 03-13-2011, 12:22 PM
  3. Newbie Dlookup problem
    By opopanax666 in forum Programming
    Replies: 7
    Last Post: 08-13-2010, 05:47 AM
  4. Newbie format number problem
    By mrbob2 in forum Queries
    Replies: 9
    Last Post: 01-18-2010, 07:18 AM
  5. Replies: 5
    Last Post: 08-05-2009, 12:13 PM

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