Results 1 to 4 of 4

Thread: REPT function

  1. #1
    New Lounger
    Join Date
    Sep 2004
    Location
    Manhattan, New York, USA
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    REPT function

    I've tried using the REPT function and the STRING$ function within a query, and both have come back as Unknown Function, despite being listed in the Expression Builder. I've tried on two PCs--one using Acc97; the other Acc2K SR1. Any idea why it doesn't work?

    Here's a sample field from my query:
    prog_num: Format([Time_Tkt_Program_ID],REPT("0",32))

  2. #2
    2 Star Lounger
    Join Date
    Dec 2000
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: REPT function

    The rept function is only available in Excel and String is not a function but a data type.

  3. #3
    New Lounger
    Join Date
    Sep 2004
    Location
    Manhattan, New York, USA
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: REPT function

    Why is REPT and STRING$ listed in the (Access) Expression Builder, then? I thought the Expression Builder was an Access-only tool. From Expression Builder, I go to Functions | Built-in Functions | Text and I see both functions.

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: REPT function

    Hi,
    REPT is indeed an Excel worksheet function so I don't know why it's appearing in your Built-in functions.
    String$ however is an Access function and should work as follows (based on what I recall of your initial example):
    Expr: format([fieldname],String$(32,"0"))
    If it's not working in that format, I'd suggest checking your References to see if you have any set that are missing.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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