Results 1 to 4 of 4

Thread: Form textbox

  1. #1
    Join Date
    Mar 2004
    Posts
    128

    Unanswered: Form textbox

    Hi all,
    I have F form, and D1,D2 textboxes in the form F.
    in the defult value of D1=Date()-1 & " 05:30:00" and D2=Date() & " 06:30:00"

    D1,D2 are used in a query called Total in the WHERE statment.
    I wrote WHERE XDate between [Forms]![F]![D1] and [Forms]![F]![D2]

    when I open the form the default values are displayed, and the query is working perfectly. But the problem, when I change the value of d2 or d1 or both and I call the query, the query don't get the right values of the two textboxes.
    For example, D1=17/12/2004 06:30:00 D2=16/12/2004 05:30:00
    I changed to D1=16/12/2004 06:30:00 D2=15/12/2004 05:30:00
    The query ignored the new values.

    What can be the problem.
    Please help...

  2. #2
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by wasimf
    Hi all,
    I have F form, and D1,D2 textboxes in the form F.
    in the defult value of D1=Date()-1 & " 05:30:00" and D2=Date() & " 06:30:00"

    D1,D2 are used in a query called Total in the WHERE statment.
    I wrote WHERE XDate between [Forms]![F]![D1] and [Forms]![F]![D2]

    when I open the form the default values are displayed, and the query is working perfectly. But the problem, when I change the value of d2 or d1 or both and I call the query, the query don't get the right values of the two textboxes.
    For example, D1=17/12/2004 06:30:00 D2=16/12/2004 05:30:00
    I changed to D1=16/12/2004 06:30:00 D2=15/12/2004 05:30:00
    The query ignored the new values.

    What can be the problem.
    Please help...
    Hi wasimf,
    Are you saying that no matter what you put in the TextBoxes that the Results stay the same? From where I see it you are getting exactly what you are requesting. REASON: You have a DEFAULT value of =Date()-1, that being you are requesting a Date that is One Day less than the CurrentDate. REMOVE the Default setting for the CurrentDate. THEN you can create the Query to accept whatever Date you put in that field. Would be neat if the fields really had some sort of meaningful name. Are they D1 for BeginningDate and D2 for EndingDate or something? It is for a range isn't it???

    Anyway, for my two-cents worth that's how I see it. Check into that and see.
    have a nice one,
    BUD

  3. #3
    Join Date
    Mar 2004
    Posts
    128

    text box

    Thanks,
    The default values are important because every one want the query of the range between today and yesterday.
    I also want to run the query for other days.
    So, is it possible to make somthing or I have to delete the default values.
    Thanks...

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by wasimf
    Thanks,
    The default values are important because every one want the query of the range between today and yesterday.
    I also want to run the query for other days.
    So, is it possible to make somthing or I have to delete the default values.
    Thanks...
    Hi wasimf,

    Well, here is another way of doing it. Not sure yet of how you can have both combined, as I'm sure you can but haven't ever done that yet. Anyway, check out the sample I made below. Input 01/01/04 in the first TextBox and then 06/01/04 in the second TextBox and then Click the OpenForm CommandButton. Or just hit Enter twice and it will do it for you. NOTE: It's already formatted for ShortDate so there is no need to use slashes (/)....just input the numbers only...i.e. 010104. Hope this either helps get what you want or points you in a better direction. I will try at some point in time to combine BOTH options together, just never had to before.

    have a nice one,
    BUD
    Attached Files Attached Files

Posting Permissions

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