Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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...

    Similar Threads Forum Date
    Self Update On The Gurdwara Blogs Apr 3, 2017
    Sikh News BREAKING: Young Sikh Shot Dead In Jalalabad, Afghanistan . - Sikh24 News & Updates Breaking News Oct 2, 2016
    Sikh News Sikh Candidate In Hamilton Disgusted By Racist Vandalism - Newstalk ZB Breaking News Aug 22, 2016
    Sikh News Amit Jani: Trump Leverages Fear In Americans, Wrong Candidate For Our Nation's Future Breaking News Feb 18, 2016
    update Blogs Oct 16, 2015

  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???
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page