Results 1 to 5 of 5
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Space$ (Access 2000)

    I am developing changes to a Clients database (Access 2000) and I'm using Access 2002 to make these changes.

    I find that Access 2002 uses Space$ to generate a number of spaces in a string variable. This bombs in Access 2000, is there an equivalent in Access 2000 or is this a missing reference?

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Space$ (Access 2000)

    Patt

    Have you checked the References. I find exactly the same Help info on Space in both 2000 and 2003, and I have no trouble getting the example from Help to work in Access 2000, without setting any special references. I have modifed the example to use Space$ rather than Space.


    Dim MyString
    ' Returns a variant with 10 spaces.
    MyString = Space$(10)

    ' Insert 10 spaces between two strings.
    MyString = "Hello" & Space$(10) & "World"
    MsgBox (MyString)


    In what context does Access use this function itself/

    John
    Regards
    John



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

    Re: Space$ (Access 2000)

    Both Space() and Space$() are VBA functions, and Access 2000, 2002 and 2003 are all built on VBA6, so it should work in all 3. The difference is that the Space() function returns a variant, while Space$() always returns a string. Is it bombing on your machine or theirs? If on theirs, be very careful that you haven't let any 2002 references get into the project.
    Charlotte

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Space$ (Access 2000)

    As I said earlier I have A2002, they have A2000. This bombs on their machine not mine.
    I will certainly check their references this morning.
    I may be back.

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Space$ (Access 2000)

    It was a missing references problem, it was including Microsoft Outlook 10.0 Object Library (from A2002) rather than Microsoft Outlook 9.0 Object Library.

    Thanks for the affirmation guys.

Posting Permissions

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