Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    May 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help w/Auto-Fill in Access 97 Form (Access 97/SR-2)

    I have an Access 97 database that has several forms. One set of the fields, on the forms, relates to Boards Members. I am trying to set up an event that will allow the Board Member to fill in his/her term start date and upon exiting the field Access will autofill in the term end date, which would be 3 years out.

    I have used the Event Procedure on the start date that is executed on AfterUpdate. I put in the following code:

    Me.End_Date_Label = DateAdd("yyyy", 3, Me.Start_Date_Label)

    However, when I test it, I keep getting the debug manager.

    Any help would be greatly appreciated.

    Thanks.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help w/Auto-Fill in Access 97 Form (Access 97/SR-2)

    Are you trying to modify a label based on another label?
    Didn't you want to update the textboxes ?
    Or do you named you textboxes with LABEL at the end of the name ?
    Francois

  3. #3
    New Lounger
    Join Date
    May 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help w/Auto-Fill in Access 97 Form (Access 97/SR-2)

    No, I'm not trying to modify a label at all.
    The text boxes are named Start Date and End Date in the Table. So I thought I would need to use column label as my control name. Am I wrong?

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help w/Auto-Fill in Access 97 Form (Access 97/SR-2)

    If the textboxes on the form are named End_Date and Start_Date you have to use :
    Me.End_Date = DateAdd("yyyy", 3, Me.Start_Date)

    If the textboxes on the form are named End Date Label and Start Date Label you have to use :
    Me.[End Date Label] = DateAdd("yyyy", 3, Me.[Start Date Label])
    Francois

  5. #5
    New Lounger
    Join Date
    May 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help w/Auto-Fill in Access 97 Form (Access 97/SR-2)

    So, does that mean the column name on the table does not have anything to do with the event?

    Thanks for your help regarding this. I really appreciate it.

    Felicia

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help w/Auto-Fill in Access 97 Form (Access 97/SR-2)

    When you use Me. you have to use the control name (textboxname), these belongs to the form (Me). The column name or field name of the table is part of the table definition.
    But it is a good practice to not name the textbox or other control the same as the field name of the table. In some situation, when they have the same name it confuse Access.
    Francois

Posting Permissions

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