Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Dates with code

Discussion in 'Information Technology' started by 72185, Jul 28, 2006.

Tags:
  1. 72185

    72185
    Expand Collapse
    Guest

    Hello All!

    I have a form where the date must be entered whenever the user records
    an account. I have it set up with 3 drop down boxes. One for the
    month, one for the day and one for the year. I know thats not the most
    efficient way but I need it like that so I can search by month/year.

    My problem is that the date they have to enter in the date one by one
    and takes more time then needed. My question is, is there a way that I
    can make it automatically display the date whenever the form is brought
    up, and still be able to search by month/year. I know you can code the
    date with now() but I don't think that is going to work in this case.

    Thanks for your help,

    -W
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News BREAKING: Young Sikh Shot Dead In Jalalabad, Afghanistan . - Sikh24 News & Updates Breaking News Oct 2, 2016
    Pacific Oil slicks spotted in search for missing Malaysia Airlines plane (Live updates) Breaking News Mar 8, 2014
    India Candidates flock to Dera Sacha Sauda Breaking News Jan 17, 2012
    India Seven SAD Candidates of SGPC Win Unopposed Breaking News Aug 27, 2011
    GurmatChanan Updates Gurbani Download Aug 27, 2011

  3. Wolfgang Kais

    Wolfgang Kais
    Expand Collapse
    Guest

    Hi "72185".

    "72185" wrote:
    > I have a form where the date must be entered whenever the user records
    > an account. I have it set up with 3 drop down boxes. One for the
    > month, one for the day and one for the year. I know thats not the most
    > efficient way but I need it like that so I can search by month/year.
    >
    > My problem is that the date they have to enter in the date one by one
    > and takes more time then needed. My question is, is there a way that I
    > can make it automatically display the date whenever the form is brought
    > up, and still be able to search by month/year. I know you can code the
    > date with now() but I don't think that is going to work in this case.


    You could use default values for the three comboboxes:
    =Month(Date())
    =Day(Date())
    =Year(Date())

    --
    Regards,
    Wolfgang
     
  4. JK

    JK
    Expand Collapse
    Guest

    Re: Dates with code - My suggestion

    Hi Seven etc :)

    I suggest a normal date field say, dtDate and a calculated search field in
    a query asf:

    srcDate:Format(Year([dtDate],"00") & Format(Month([dtDate],"00") &
    Format(Day([dtDate],"00")

    Sort on that field and put it in a combo box as the first column and a
    visible dtDate column next to it and bingo

    For clarity you can put spaces dot or whatever between the elements but that
    would mean more key strokes when searching eg.
    srcDate:Format(Year([dtDate],"00") & "." & Format(Month([dtDate],"00") &
    "." & Format(Day([dtDate],"00")

    Regard/JK


    "72185" <ws72185@yahoo.com> wrote in message
    news:1153740904.975082.293040@m79g2000cwm.googlegroups.com...
    > Hello All!
    >
    > I have a form where the date must be entered whenever the user records
    > an account. I have it set up with 3 drop down boxes. One for the
    > month, one for the day and one for the year. I know thats not the most
    > efficient way but I need it like that so I can search by month/year.
    >
    > My problem is that the date they have to enter in the date one by one
    > and takes more time then needed. My question is, is there a way that I
    > can make it automatically display the date whenever the form is brought
    > up, and still be able to search by month/year. I know you can code the
    > date with now() but I don't think that is going to work in this case.
    >
    > Thanks for your help,
    >
    > -W
    >
     
  5. fredg

    fredg
    Expand Collapse
    Guest

    On 24 Jul 2006 04:35:05 -0700, 72185 wrote:

    > Hello All!
    >
    > I have a form where the date must be entered whenever the user records
    > an account. I have it set up with 3 drop down boxes. One for the
    > month, one for the day and one for the year. I know thats not the most
    > efficient way but I need it like that so I can search by month/year.
    >
    > My problem is that the date they have to enter in the date one by one
    > and takes more time then needed. My question is, is there a way that I
    > can make it automatically display the date whenever the form is brought
    > up, and still be able to search by month/year. I know you can code the
    > date with now() but I don't think that is going to work in this case.
    >
    > Thanks for your help,
    >
    > -W


    Don't use the 3 drop-downs.
    Add a DateField Date datatype to your table.
    As default value on the field:
    =Date()
    All new records will automatically have the current date entered.

    Then, whenever you need to return records of a particular month, as
    criteria in a query:
    Where Format(YourTable.[DateField],"mm/yyyy") = [Enter the Month and
    year mm/yyyy]

    Enter 05/2006 to get records for May of this year.
    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail
     

Share This Page