Results 1 to 10 of 10
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Hyperlink 'input mask' (2002 SP-2)

    A while back I was able to implement a method where I can save pdf images of orders as a hyperlink , thanks in large part to help from Hans V (good bye to all those stacks of faxes and (mostly lost) email attachments). I have discovered that a Copy/Paste method is rather cumbersome (the images reside on a seperate USB2 drive) so I have been typing in the path myself (not much less cumbersome).

    A "typical" path is: F:OrderImages828309.1.pdf
    The "numerical" portion of the path is the customers order number; everything else remains the same for every link. The problem I'm having is that I have to type the entire path in every time, and that has lead to typo errors that are not discovered until I try to look up the image. Additionally, and here is where (I presume) the problem may lie; not all orders follow the same format. They can be just about any combination of alpha/numeric data. I'm looking for a way to have a kind of "input mask" that would allow any combination of characters between "F:OrderImages" and ".pdf"; or at least a warning that I've made an input error. I suppose I will have to be satisfied that it cannot check the actual order number entry.

    As always, any and all input/advise/code appreciated.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink 'input mask' (2002 SP-2)

    You can't use an input mask as the characters of an input mask are not stored in the field.
    What about to set the path as default value.
    In the On Got Focus of the textbox you can use :
    Private Sub YourTextbox_GotFocus()
    Me.YourTextbox.SelStart = Len(Me.YourTextbox)
    End Sub
    to set the cursor to the end of the text, ready to enter the file name.
    Francois

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Hyperlink 'input mask' (2002 SP-2)

    Thanks Francois, but . . .

    Private Sub txtOrderImage_GotFocus()
    Me.txtOrderImage.SelStart = Len(Me.txtOrderImage)
    End Sub

    (Len portion contains the "Null" value)
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink 'input mask' (2002 SP-2)

    Do you get this error in the On Got Focus code?
    Try :
    Private Sub YourTextbox_GotFocus()
    If Not IsNull(Me.yourTextbox) Then
    Me.YourTextbox.SelStart = Len(Me.YourTextbox)
    End If
    End Sub
    Francois

  5. #5
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Hyperlink 'input mask' (2002 SP-2)

    Hmm. . .
    That corrected the Error msg, but there's no default value - just an empty text box.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink 'input mask' (2002 SP-2)

    Bryan,

    Default Values will only work for NEW records.
    If you want to fill in existing records, you'll have to run an update query.
    Francois

  7. #7
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Hyperlink 'input mask' (2002 SP-2)

    Francois:

    I see (said the blind man).
    After some experimenting, I see where I was getting lost. The form I was working with was the Order Detail Form (that form only exists after it is created by New Order Form). I put the default value and your code in the New Order Form and it works just fine. I also noticed what you mentioned about the "update" query. Once the record is created, there's no way to edit the hyperlink (at least from the form). I did notice that you can right-click the link in the table and edit it, but not in the form (curious, but I suppose there's a reason for that - aside from the fact that direct table entries are a bit of a no-no).

    Might I be able to use some code to double-click the order number (not the hyperlink) and have it open to the table entry (Link Criteria = txtOrderNo)? I've done that to open another form, but never a table.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  8. #8
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink 'input mask' (2002 SP-2)

    Bryan,

    I wouldn't try to open a table to edit records directly.
    I've done some testing and come to the following attachment.
    To enter a new record, when you enter the hyperlink field, just press F2 to edit the field.
    If you want to edit a hyperlink, just click on the Edit Link button in the record you want to change.
    I have add some code in the after update event of the hyperlink field to ensure the the # are added if they are missing.
    Is this workable for you ?
    Francois

  9. #9
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Hyperlink 'input mask' (2002 SP-2)

    Francois:

    Thanks, once again, for coming to the rescue. Your solution is simple, almost elegant, and works quite well. Question: What are the " # " for? I actually removed them when doing an edit (before adding your After Update code) and it made no difference - the link works as well without them as with.

    Also, when I went to open the db I encountered the attached msg. I suppose this must be a "feature" of XP SP-2. Not a problem, but I thought I might share it with anyone who might be surprised by it if they have the SP-2 patch. It's simply a matter of right-clicking the db, select properties, and at the bottom you will have the option to unblock it (ignoring the security issues). Once you unblock it, it remains unblocked (you don't need to do it every time you open it in the future).

    Thanks again Francois, well done! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  10. #10
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink 'input mask' (2002 SP-2)

    Bryan,

    When you insert a hyperlink in a field by code you have to surround the string by #. I thought it was the same when you use a form but it seems the form is taking care of it. I put the code without testing it with no code.
    Francois

Posting Permissions

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