Unbound text box as label

Ask a Question related to Microsoft Access, Design and Development.

  1. #1

    Default Unbound text box as label

    I have an application form that is used from year to year for the same
    agencies.
    I want to create a label that displays the year the form is used. I have an
    unbound text box and I want to write code that will look at the date field
    on the form and bring back a label for the year.

    I think the code is something like this:

    Dim strFund

    If [Application Date] > 1/1/2001 and < 12/31/2001 then strFund = "2001"
    else if [Applicaiton Date] > 1/1/2002 and < 12/31/2002 then strFund= "2002"

    I am not a programmer, please excuse any gross errors. Can you please help
    me? Thanks much!!!
    LAR-S


    lars Guest

  2. Similar Questions and Discussions

    1. Animate when text label changes...
      I'm a new bee and I appriciate if anyone can help me on this.. Is is possible to 'animate' or apply some kind of effect (blur or fade or...
    2. Changing text on asp-label
      Is it possible to change the text in a label from english to german like cultureinfo in Visual studio? regards reidarT
    3. Getting text of a label in a datalist.
      I have a label in a datalist. I can reach it by controls collection of datalist. I can get its ID or change its visible property but I can't get...
    4. aligning text in a asp label
      You can try using css. Create a custom css-class for your label and give the parameters in the css file. "Kay" <kokeeffe@proteus.ie> wrote in...
    5. Unbound Text Box
      See reply in m.p.a.formscoding group. -- Ken Snell <MS ACCESS MVP> "Grant" <gwl@map.com> wrote in message...
  3. #2

    Default Unbound text box as label

    You can display a value of a textbox control that is bound
    to a date field several ways.

    By far the simplest is in the properies window of the form
    enter YYYY in the format property. This will do the job
    for you.

    You can also format the control with Format([Application
    Date],"YYYY") either in the format property of in your
    code.

    The 3rd way is: Year([Application Date]) which will also
    have the same result.

    The last 2 can also be applied to the Recourd Source if
    the source is a query.

    Bish...
    >-----Original Message-----
    >I have an application form that is used from year to year
    for the same
    >agencies.
    >I want to create a label that displays the year the form
    is used. I have an
    >unbound text box and I want to write code that will look
    at the date field
    >on the form and bring back a label for the year.
    >
    >I think the code is something like this:
    >
    >Dim strFund
    >
    >If [Application Date] > 1/1/2001 and < 12/31/2001 then
    strFund = "2001"
    >else if [Applicaiton Date] > 1/1/2002 and < 12/31/2002
    then strFund= "2002"
    >
    >I am not a programmer, please excuse any gross errors.
    Can you please help
    >me? Thanks much!!!
    >LAR-S
    >
    >
    >.
    >
    Bish Guest

  4. #3

    Default Re: Unbound text box as label

    Thanks for your answers.

    In the case of a fiscal year where the actual dates cross from one year into
    another, I would need the formula. Example being July 1, 2002 through June
    30, 2003.

    "Joan Wild" <jwild@nospamtyenet.com> wrote in message
    news:ugqU9pJRDHA.3880@tk2msftngp13.phx.gbl...
    > Just set the control source of the textbox to
    > =Year([Application Date])
    >
    > --
    > Joan Wild
    > Microsoft Access MVP
    >
    > "lars" <lrstone@co.santa-barbara.ca.us.nospam> wrote in message
    > news:OhJlTfJRDHA.2332@TK2MSFTNGP10.phx.gbl...
    > > I have an application form that is used from year to year for the same
    > > agencies.
    > > I want to create a label that displays the year the form is used. I
    have
    > an
    > > unbound text box and I want to write code that will look at the date
    field
    > > on the form and bring back a label for the year.
    > >
    > > I think the code is something like this:
    > >
    > > Dim strFund
    > >
    > > If [Application Date] > 1/1/2001 and < 12/31/2001 then strFund = "2001"
    > > else if [Applicaiton Date] > 1/1/2002 and < 12/31/2002 then strFund=
    > "2002"
    > >
    > > I am not a programmer, please excuse any gross errors. Can you please
    > help
    > > me? Thanks much!!!
    > > LAR-S
    > >
    > >
    >
    >

    lars Guest

  5. #4

    Default Re: Unbound text box as label

    Just set the control source of the textbox to
    =Year([Application Date])

    --
    Joan Wild
    Microsoft Access MVP

    "lars" <lrstone@co.santa-barbara.ca.us.nospam> wrote in message
    news:OhJlTfJRDHA.2332@TK2MSFTNGP10.phx.gbl...
    > I have an application form that is used from year to year for the same
    > agencies.
    > I want to create a label that displays the year the form is used. I have
    an
    > unbound text box and I want to write code that will look at the date field
    > on the form and bring back a label for the year.
    >
    > I think the code is something like this:
    >
    > Dim strFund
    >
    > If [Application Date] > 1/1/2001 and < 12/31/2001 then strFund = "2001"
    > else if [Applicaiton Date] > 1/1/2002 and < 12/31/2002 then strFund=
    "2002"
    >
    > I am not a programmer, please excuse any gross errors. Can you please
    help
    > me? Thanks much!!!
    > LAR-S
    >
    >

    Joan Wild Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139