• non event code

    • This topic has 3 replies, 3 voices, and was last updated 16 years ago.
    Author
    Topic
    #459648

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #1159548

      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.

      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

    • #1159556

      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.

      • #1159744

        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.

    Viewing 1 reply thread
    Reply To: non event code

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: