Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jul 2001
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    RunCode error (97)

    Well if i can get this to work that would be great. I entered the code into a VB module in access as follows
    I recived it from another forum but something i am doing is wrong.


    Public Function TrnsfrToXls()

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "Find All Issues by Selected Criteria2", "C:WINNTProfilesEdward SantevecchiDesktopFind All Issues By Selected Criteria2.xls"

    End Function


    All of the coding is on 1 line correct? The "Find All Issues by Selected Criteria" is not a table but a datasheet created by the query. Is that a problem, if so how would i change that to a table. Have i set the paths up incorrectly?

    My access macro first opens the query (Find All issues....) in DATASHEET view with the mode set to EDIT.

    Then I have output to my xls file (Find all ISSues...)

    I then use RunCode and use the line:
    Function Name = TrnsfrToXls(). {for some reason access says that i have entered the function name incoorectly and it can not find it, have i used an improper format. I thought it was function name = function name().

    Next i close the query. What am i doing wrong with the function name? Why can't i run the code? Is there something dumb i am missing here with my procedures? Thank you and happpy new year.

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: RunCode error (97)

    This is the third time I have read this message. Please do not post in multiple forums unless you get a reply in one forum suggesting a better place to post a question.
    Legare Coleman

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: RunCode error (97)

    Legare already pointed out that you had posted this question elsewhere. Sometimes that is done because you aren't sure where it should be posted, but if you really do need to cross-post, you should make a notation in the post that the question was also posted in the other forum.

    You need to put not only 97 in the version, but also what application it is. This particular forum contains threads on VB and all the Office apps, so 97 suggests you're using Office but not much else.

    I would suggest posting any Access-specific questions in the Access forum. You do see questions here in VB/VBA/.Net occasionally, but they pertain to using Visual Basic with Access (not Access VBA) or involve automating Access from another application.

    Since this question is posted elsewhere, I'm going to lock this thread to avoid partial threads all over the Lounge.
    Charlotte

Posting Permissions

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