Results 1 to 5 of 5
  1. #1
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317

    Like an input mask but different ('http://')

    Folks



    I have a URL field in a form, and I want to force users to start their URLs with 'http://'.

    An input mask won't cut it, for two reasons. First, I've tried using 'http://' followed by 'C' two hundred times, but it's then impossible to paste a URL into the field other than in chucks of nine characters. Second, sometimes the cut-and-pasted URL will already start with 'http://', resulting in a doubling up of 'http://'.

    I suppose what I need is a validation rule that requires the first seven characters of the value entered to be, in order, 'h', 't', 't', 'p', ':', '/' and '/'. How would I achieve this? Have you any better ideas?

    Remster

    PS As a subsidiary question, is there an input mask character that represents a string of unspecified length?

    PPS A message from my nephew Benjamin:

  2. #2
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317
    I'm off home to try 'Like "http://*"'. I've no idea whether it will work, but it's all my research has thrown up so far. (I'm still interested in my postscript question, by the way.)

  3. #3
    LillMcGill is offline Dagny fan
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Location
    Southern USA
    Posts
    70
    It will work if it is a text field, but not if the data type is hyperlink.

    PS: I don't know of any way to specify only the beginning of the pattern in an input mask.

  4. #4
    LillMcGill is offline Dagny fan
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Location
    Southern USA
    Posts
    70
    Oh and you could very easily have a bit of code to see if the entry starts with http:// , leaving it alone if it does, and concatenate http:// to the beginning if not.

  5. #5
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317
    Thanks, Lill. As it happens, the other method I mentioned seems to work.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Input mask frustration (decimals)
    By Remster in forum Forms
    Replies: 2
    Last Post: 10-29-2010, 09:33 AM
  2. Phone Input Mask issue
    By Huddle in forum Forms
    Replies: 4
    Last Post: 08-13-2010, 03:02 PM
  3. Newbie input mask Q and paswords setting
    By Cincity in forum Programming
    Replies: 2
    Last Post: 08-01-2010, 12:42 AM
  4. day of week input mask
    By jacko311 in forum Programming
    Replies: 7
    Last Post: 11-15-2009, 12:56 PM
  5. Input mask
    By doobybug in forum Access
    Replies: 2
    Last Post: 06-17-2009, 09:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums