Results 1 to 5 of 5
  1. #1
    groovychick is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    5

    Transfer date to another field

    Can anyone help? I'm creating a training database. Individuals carry out their training and I enter their training regime in three fields - year 1, year 2 and year 3. For example, their year 1 training is 1 august 11, year 2 is 1 august 12 and year 3 is 1 august 13. I can then run reports on who is due over the next 3 years and when.



    However, I'd like to archive their past training dates. I have no idea how to do this.

    Say individual had following dates in their record as due dates:

    Year 1 - 1 august 11
    Year 2 - 1 august 12
    Year 3 - 1 august 13

    They carry out their year 1 training so that field would now have to change to 1 august 2014 (this training just runs and runs). Is there a way to add a command button that when clicked archives the 1 august 11 date already there to year 1 archive field and clears the year 1 field so that new date can be added. I've tried below but probably not right. I'm very amateur at this sort of thing. Sorry.

    Code:
    Me.txtboxYear1field = Me.txtboxyear1archivefield
    textboxYear1field.Value = ""

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

    You are on the right track, given your table layout.

    However, you say that training goes on and on. You will have a much easier path if you put the training dates in a separate table with the individual ID as a foreign key. With that arrangement, you could keep as many dates as necessary and not have to deal with moving them.

  3. #3
    groovychick is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    5
    Thank you for your reply, HertfordKC. I do see what you're saying and I would really like to hold all the dates. However, trying to set this up so that administrators who are entering the data don't have to do anything other than click buttons, as all they can do in access.

    Thing is, I want the database set up so that they only have to change current training dates as they are undertaken and old dates are automatically put somewhere else when they click in the field or on a command button. I just don't know how to set this up.

    Also, when I tried the code I made up I got an error. I'm not really sure where to go next to be honest!

  4. #4
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481
    'The VBA references trap everyone. See the following link for a concise description of how you must reference controls:
    http://www.access-programmers.co.uk/...d.php?t=147019

    For additional info, google 'access vba reference control'

  5. #5
    groovychick is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    5
    Many thanks, Hertfordkc. Will try again!

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

Similar Threads

  1. Getting Just the Date part of Date/Time field
    By GaryElwood in forum Reports
    Replies: 7
    Last Post: 09-28-2011, 09:58 AM
  2. Replies: 1
    Last Post: 02-06-2011, 06:36 PM
  3. Replies: 1
    Last Post: 11-13-2010, 12:57 PM
  4. Set date field on subform to date variable
    By laavista in forum Access
    Replies: 4
    Last Post: 06-30-2010, 06:32 PM
  5. set date field on form to date variable
    By laavista in forum Access
    Replies: 3
    Last Post: 06-28-2010, 03:03 AM

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