Consulting

Results 1 to 7 of 7

Thread: #name for calculated field on a single machine

  1. #1
    VBAX Mentor Movian's Avatar
    Joined
    Aug 2008
    Location
    NC, USA
    Posts
    399

    #name for calculated field on a single machine

    Hey,
    have another interesting problem, we have a field that is calculated with =Format(Currdate,"YYYY-MM-DD") with CurrDate being a text box with a date (selected using a date picker).

    This works fine on almost every machine we have installed on. However i have a machine at a clients office that instead of generating the formated date in the text field, fails and displays a #name even though the field is not tied to a data field of any description (This field is used to get a formated date to attach to the front of files that are generated).

    Anyone have an idea why this one machine would be doing this?

    It does have another quirk in that our .net based launcher does not display correctly and simply cuts to the end of the code to launch the .accdr without actualy checking for downloads. Thinking of re installing .net (Although i have already re installed access run time twice (once back to the same version of 2007 and once updating to 2010)).

    As always your help is apriciated.
    "From the ashes of disaster grow the roses of success" - Chitty chitty bang bang

    "I fear not the man who has 10,000 kicks practiced once. I fear the man who has 1 kick practiced 10,000 times" - Bruce Lee

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location


    Any reason you are not just formatting the Cell and using the TextBoxes' ControlSource Property?

    Have you tried using
    Cell = NumberFormat(Me.Currdate.Text),"YYYY-MM-DD")
    What is the actual output of the
    MsgBox Me.DatePicker
    and of
    MsgBox Me.Currdate.text
    Can you format the output of the DatePicker? Are they compatible with Format or NumberFormat?

    Have you checked his workbooks Date1904 Property?

    How about language settings incompatibilities?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Mentor Movian's Avatar
    Joined
    Aug 2008
    Location
    NC, USA
    Posts
    399
    When i say datepicker i mean the built in access datepicker that appears when you have a textbox set to a date type.

    The datepicker just enters the date as text into the text box (8/28/2013 for example).

    We like to use a formated version of this (using ISO 8601 standard) for file names and rather than having to use a format(currdate,"YYYY-MM-DD) command every time we need to reference it.

    We have the field with the controlsource set to the format of the date so we can just reference that text box.

    I have however noticed somthing strange, when our users login very briefly a window appears titles somthing to similar to "Searching dao36.dll" so i am putting an educated guess that certain dll files are not present and or correctly registered on the system.

    We have had similar things happen for our clients that use a different version of our system that needs a custom dll to be registered and that dll is not present. It screws up the dates amongst other things when the referenced dll is missing.

    So will see if i can investigate that further.
    "From the ashes of disaster grow the roses of success" - Chitty chitty bang bang

    "I fear not the man who has 10,000 kicks practiced once. I fear the man who has 1 kick practiced 10,000 times" - Bruce Lee

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Movian,

    I am still trying to picture the trail the data(Date) takes.

    It sounds like the data gets pulled from the DB via a Query and pushed into a TextBox, then pushed, via ControlSource, into a spreadsheet Cell, then pulled, via ControlSource, into a TextBox. Obviously, this is not the case, it's just what I gather from your descriptions above

    Somewhere in there it gets reformatted from "m/dd/yyyy" to "yyyy-mm-dd."

    Finally, some code accesses the TextBox to use the "yyyy-mm-dd" as a Workbook Name.



    Can you post the reformat code? Tell us the source, but use a String variable or constant set to a "yyyy-mm-dd" date as a replacement for the actual source. Also use or tell us the destination object.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  5. #5
    VBAX Mentor Movian's Avatar
    Joined
    Aug 2008
    Location
    NC, USA
    Posts
    399
    http://www.nomoredictation.com/movian/Example.accdb

    I tried to upload a sample DB with the same setup to illistrate the point however even though accdb is an accepted format in the list of formats. The uploader refused to upload it...

    At any rate this sample DB has the same setup used with a text box storing the date and a second one generating a formated date.

    (The difference being the production DB uses an SQL back end.)

    Now this works fine for all of our clients and on hundreds of workstations but this one machine has problems. Where by the second box (the one thats formated) will display #name instead of the formated date as this one does.
    "From the ashes of disaster grow the roses of success" - Chitty chitty bang bang

    "I fear not the man who has 10,000 kicks practiced once. I fear the man who has 1 kick practiced 10,000 times" - Bruce Lee

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Quote Originally Posted by Movian
    with a text box storing the date and a second one generating a formated date.
    That is what I was looking for.

    You say that the second TextBox code is what is formatting the date.


    Quote Originally Posted by SamT
    Can you post the reformat code? Tell us the source, but use a String variable or constant set to a "yyyy-mm-dd" date as a replacement for the actual source. Also use or tell us the destination object.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  7. #7
    VBAX Mentor Movian's Avatar
    Joined
    Aug 2008
    Location
    NC, USA
    Posts
    399
    The source control on the seond text box is as follows

    =Format(Currdate,"YYYY-MM-DD")

    as per the example DB i linked
    "From the ashes of disaster grow the roses of success" - Chitty chitty bang bang

    "I fear not the man who has 10,000 kicks practiced once. I fear the man who has 1 kick practiced 10,000 times" - Bruce Lee

Posting Permissions

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