Results 1 to 6 of 6
  1. #1
    Join Date
    May 2006
    Posts
    386

    Unanswered: How to get auto date in a query ?

    Dear friends,

    I am trying to get Today's date in a query but it doenst work. I wan the today's date to automatically appear as a user ticks the check box which says "ClientPaid". If a user ticks the check box (Yes) then I expect Today's date to appear in the next field which is called "DateInvPaid".

    I have written this express against the "DateInvPaid" field.
    DateInvPaid: IIf([Booking].[ClientPaid]=Yes,[=Date()])
    but when I run the query it asks me to " Enter Parametere Value" =Date().

    Do you think I am missing out something in the expression?
    Thanks for your help.
    Emi-UK
    Love begets Love, Help Begets Help

  2. #2
    Join Date
    Feb 2004
    Location
    Wales
    Posts
    343
    Your asking a query to action for you. Put the action in a form (if using one) and set the text box to update the table its easier - might be wise to set the calculation so taht if 0 the "" else DATE(). this way if you accidently tick the box then you can "undate" the paid box"

  3. #3
    Join Date
    May 2006
    Posts
    386
    But the problem is that I am not using a form and actually this query is created on a form and after selecting a client then the records appear at the bottom (query) in there i want to tick if payments received and by clicking the date should automatically appear.

    I would be very grateful if you could help me with this.
    Emi-UK
    Love begets Love, Help Begets Help

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Try setting the date for your textbox in the AfterUpdate event of the checkbox ... Ex:

    Private MyCombo_AfterUpdate()

    MyTextBox.Value=format(Now,"ShortDate)

    End Sub
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    May 2006
    Posts
    386
    Hi Owen, but my pronblem is not with any text box. Basically I have a query that has some fields e.g. Date of Job, AmountPayment Received. Date Payment Received and Payment Received and this PaymentReceived field is a yes/no field and I want to be able that just by ticking the chekbox that date should automatically appear in the Date Payment Received Field. Please bear in mind that I am using a query and and not a form.
    THanks for your help.
    Emi-UK
    Love begets Love, Help Begets Help

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Emal
    Dear friends,

    I am trying to get Today's date in a query but it doenst work. I wan the today's date to automatically appear as a user ticks the check box which says "ClientPaid". If a user ticks the check box (Yes) then I expect Today's date to appear in the next field which is called "DateInvPaid".

    I have written this express against the "DateInvPaid" field. but when I run the query it asks me to " Enter Parametere Value" =Date().

    Do you think I am missing out something in the expression?
    Thanks for your help.
    RE: Your last post. WHEN are you checking this? Is this in the QBE? You stated that there is no form ... So, you can't be interacting with the query while it's running(invoked) ... That leaves only while BUILDING/editing the query ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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