Results 1 to 4 of 4

Thread: non event code

  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a date field on a form, when this date has been reeched and passed I need a tick box to auto change to yes. Is this possible and since this is not an event how would I model my code?

    Many thanks, Darren.

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='iksotof' post='774054' date='07-May-2009 20:57']I have a date field on a form, when this date has been reeched and passed I need a tick box to auto change to yes. Is this possible and since this is not an event how would I model my code?

    Many thanks, Darren.[/quote]
    You could use the following in a query that is the recordsource of the form,
    TickBoxField: IIf(Datefield >= Date(), True, False)
    Datefield and tickboxfield are fields in the query. Substitute your own names.
    HTH

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Patt, I'd like to do it in Vb if possible. What I have is main form A, sub b and sub C. The date is on sub c and the control i want to show as yes is on
    sub B. So if the date in sub c is say 07 may, I need tick in sub b to show yes lets say seven days later. Any thoughts would be most helpful. My forms are bound to tables.


    Thanks, Darren.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I'd use the On Current event of sub B for this: when the user moves to a different record, the code looks at the date value on sub C and if today is at least a week later than that date, it ticks a check box.

    See Refer to Form and Subform properties and controls to learn how to refer to a control on a subform.

Posting Permissions

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