Welcome to SPN

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

Sign Up Now!

Date Function in VB code

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

  1. Bill M

    Bill M
    Expand Collapse
    Guest

    I am creating the following ID using the date function:

    Me![QuoteID] = Me![QuoteID] & "." & Format(Month(Date), "00") &
    Format(Day(Date), "00") & Year(Date) & "." & Format(Me![QuoteIndex], "0000")

    And I am getting an error message on some machines: "Duplicate: Action
    failed. Function not available in Query Date"

    What does this mean and how do I fix it???
     
  2. Loading...


  3. kabaka

    kabaka
    Expand Collapse
    Guest

    Thought 1:
    It looks to me like you are trying to concatenate (in a form?) values that
    are of type text, date, & possibly integer. I'd put a CTEXT(...) around each
    piece to ensure that you are concatenating text.

    Thought 2:
    Is this textbox linked to a field in a table? It almost sounds like your
    error message is the result of duplicate keys being created.


    "Bill M" wrote:

    > I am creating the following ID using the date function:
    >
    > Me![QuoteID] = Me![QuoteID] & "." & Format(Month(Date), "00") &
    > Format(Day(Date), "00") & Year(Date) & "." & Format(Me![QuoteIndex], "0000")
    >
    > And I am getting an error message on some machines: "Duplicate: Action
    > failed. Function not available in Query Date"
    >
    > What does this mean and how do I fix it???
     
  4. Douglas J. Steele

    Douglas J. Steele
    Expand Collapse
    Guest

    Two common reasons.

    The first is that you've used Date somewhere else in your database: a field
    in a table, a control on a form, or something like that. Date is a reserved
    word, and should never be used in anything you created in the database.

    The other possibility is that your references are messed up.

    References problems can be caused by differences in either the location or
    file version of certain files between the machine where the application was
    developed, and where it's being run (or the file missing completely from the
    target machine). Such differences are common when new software is installed.

    On the machine(s) where it's not working, open any code module. Select Tools
    | References from the menu bar. Examine all of the selected references.

    If any of the selected references have "MISSING:" in front of them, unselect
    them, and back out of the dialog. If you really need the reference(s) you
    just unselected (you can tell by doing a Compile All Modules), go back in
    and reselect them.

    If none have "MISSING:", select an additional reference at random, back out
    of the dialog, then go back in and unselect the reference you just added. If
    that doesn't solve the problem, try to unselect as many of the selected
    references as you can (Access may not let you unselect them all), back out
    of the dialog, then go back in and reselect the references you just
    unselected. (NOTE: write down what the references are before you delete
    them, because they'll be in a different order when you go back in)


    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no private e-mails, please)


    "Bill M" <BillM@discussions.microsoft.com> wrote in message
    news:F55BDFBB-1B2B-4FC7-B3B5-02FD375F3182@microsoft.com...
    >I am creating the following ID using the date function:
    >
    > Me![QuoteID] = Me![QuoteID] & "." & Format(Month(Date), "00") &
    > Format(Day(Date), "00") & Year(Date) & "." & Format(Me![QuoteIndex],
    > "0000")
    >
    > And I am getting an error message on some machines: "Duplicate: Action
    > failed. Function not available in Query Date"
    >
    > What does this mean and how do I fix it???
     
  5. kabaka

    kabaka
    Expand Collapse
    Guest

    I defer to Douglas' wisdom.




    "kabaka" wrote:

    > Thought 1:
    > It looks to me like you are trying to concatenate (in a form?) values that
    > are of type text, date, & possibly integer. I'd put a CTEXT(...) around each
    > piece to ensure that you are concatenating text.
    >
    > Thought 2:
    > Is this textbox linked to a field in a table? It almost sounds like your
    > error message is the result of duplicate keys being created.
    >
    >
    > "Bill M" wrote:
    >
    > > I am creating the following ID using the date function:
    > >
    > > Me![QuoteID] = Me![QuoteID] & "." & Format(Month(Date), "00") &
    > > Format(Day(Date), "00") & Year(Date) & "." & Format(Me![QuoteIndex], "0000")
    > >
    > > And I am getting an error message on some machines: "Duplicate: Action
    > > failed. Function not available in Query Date"
    > >
    > > What does this mean and how do I fix it???
     

Share This Page