From: kevcar40 on
hi
i have several textboxes on a form
txtdate (unbound) control source =date() and formatted as yyyy
only the year required
txtholddate (bound) the value of txtdate is passed to the textbox and
saved on the table
txtrecordindex this textbox count the number of records created in the
year

what i am trying to do is check the year on opening the form, if the
year is the same as the value stored on the table then just carry on
normal ie increment the recordindex
if the year is different reset the recordindex to 1 i.e start of new
year

i have tried

if txtdate > txtholddate then
msgbox"different"
reset
....
else
msgbox "same"
increment
.......
end if

problem is every time open the form i am getting the "different"
message which resets the recordindex

How do i compare the years correctly


thanks

kevin

the years on the table are the same as the value in the textbox


how do i




From: Salad on
kevcar40 wrote:

> hi
> i have several textboxes on a form
> txtdate (unbound) control source =date() and formatted as yyyy
> only the year required
> txtholddate (bound) the value of txtdate is passed to the textbox and
> saved on the table
> txtrecordindex this textbox count the number of records created in the
> year
>
> what i am trying to do is check the year on opening the form, if the
> year is the same as the value stored on the table then just carry on
> normal ie increment the recordindex
> if the year is different reset the recordindex to 1 i.e start of new
> year
>
> i have tried
>
> if txtdate > txtholddate then
> msgbox"different"
> reset
> ....
> else
> msgbox "same"
> increment
> .......
> end if
>
> problem is every time open the form i am getting the "different"
> message which resets the recordindex
>
> How do i compare the years correctly
>
>
> thanks
>
> kevin
>
> the years on the table are the same as the value in the textbox
>
>
> how do i
>
What happens if you use/store Year(Holddate) and Year(date()) to the
textboxes?

From: kevcar40 on
On 1 Mar, 16:27, Salad <sa...(a)oilandvinegar.com> wrote:
> kevcar40 wrote:
> > hi
> > i have several textboxes on a form
> > txtdate (unbound)  control source  =date()  and formatted as yyyy
> > only the year required
> > txtholddate (bound) the value  of txtdate is passed to the textbox and
> > saved on the table
> > txtrecordindex this textbox count the number of records created in the
> > year
>
> > what i am trying to do is check the year on opening the form, if the
> > year is the same as the value stored on the table then just carry on
> > normal ie increment the recordindex
> > if the year is different reset the recordindex to 1 i.e start of new
> > year
>
> > i have tried
>
> >   if   txtdate > txtholddate then
> >       msgbox"different"
> >       reset
> >       ....
> >  else
> >     msgbox "same"
> >     increment
> >     .......
> > end if
>
> > problem is every time open the form i am getting the "different"
> > message which resets the recordindex
>
> > How do i compare the years  correctly
>
> > thanks
>
> > kevin
>
> > the years on the table are the same as the value in the textbox
>
> > how do i
>
> What happens if you use/store Year(Holddate) and Year(date()) to the
> textboxes?- Hide quoted text -
>
> - Show quoted text -

will try and let you know
thanks