Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    Hertfordshire, England
    Posts
    78

    Unanswered: Refer to Text Field Containing Date

    I have an append query that appends data from one table to the same table basically duplicating data but one field does not append so appends blank. That's the ok bit. The query is set to copy records for a specified date only and this date is in a text field on another form.

    So in the query I say for the date column in the criteria part: Forms!frmmain!txtdate. Now on that form frmmain there is a text field called txtdate and it does contain a date at the moment it is 29/11/2006. The query when run brings back no records. If I remove the criteria in date it works and displays all data in the table and I can see 7 records with 29/11/2006. If I type in the criteria as #29/11/2006# it filters ok and brings back 7 records.

    So why won't it take the criteria when I refer to the date in a text field?

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Forms!frmmain!txtdate.text (or .value)

    OR

    Check the Format() property of the text field.
    George
    Home | Blog

  3. #3
    Join Date
    Sep 2003
    Location
    Hertfordshire, England
    Posts
    78
    Hi

    Thanks for that. I 've realised what I had done is was trying to run the query when my code had stopped in debug and so the query would not run. If I hadnt put break points on before that query then it would have worked.

    Neil.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    *chuckle*

    Good-O
    George
    Home | Blog

Posting Permissions

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