Results 1 to 4 of 4
  1. #1
    Feddy is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2016
    Location
    Space Coast Florida
    Posts
    11

    Inserting Field data into URL

    Hi, First post here so please bear with me.



    i am attempting to gather an entry from an active form field and insert it into a URL so that i can go to the dell support website.

    i tried to find information on this using Googlefu and unfortunately it doesn't seem common, i started playing around in code builder, this is what i have so far:

    ActiveWorkbook.FollowHyperlink Address:="http://www.dell.com/support/home/us/en/19/product-support/servicetag/(service tag#.value)/configuration", NewWindow:=True

    i found this code snippet on the internet, so i'm not 100% it will work, but i just need the value of the field "Service Tag#" at the appropriate place.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    ActiveWorkbook.FollowHyperlink Address:="http://www.dell.com/support/home/us/en/19/product-support/servicetag/" & [fieldname] & "/configuration", NewWindow:=True

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    IN a query, combine the 2 items into a field:
    select "http://www.dell.com/support/home/us/en/19/product-support/servicetag/" & tagID & "/configuration" as URL from table

    Paste this code into a module, and it will open ANY file in its native application.
    if the query is in a form, then click a button to run the code:

    usage: OpenNativeApp txtBox
    it will open the URL in IE if the item in txtBox is a website
    it will open the doc in Word if the item in txtBox is C:\myfile.doc
    if its just a file path, it will open in file explorer.

    Code:
    'Attribute VB_Name = "modNativeApp"
    'Option Compare Database
    Option Explicit
    
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long
    
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    Const SW_SHOWNORMAL = 1
    Const SE_ERR_FNF = 2&
    Const SE_ERR_PNF = 3&
    Const SE_ERR_ACCESSDENIED = 5&
    Const SE_ERR_OOM = 8&
    Const SE_ERR_DLLNOTFOUND = 32&
    Const SE_ERR_SHARE = 26&
    Const SE_ERR_ASSOCINCOMPLETE = 27&
    Const SE_ERR_DDETIMEOUT = 28&
    Const SE_ERR_DDEFAIL = 29&
    Const SE_ERR_DDEBUSY = 30&
    Const SE_ERR_NOASSOC = 31&
    Const ERROR_BAD_FORMAT = 11&
    
    
    Public Sub OpenNativeApp(ByVal psDocName As String)
    Dim r As Long, msg As String
    
    r = StartDoc(psDocName)
    If r <= 32 Then
        'There was an error
        Select Case r
            Case SE_ERR_FNF
                msg = "File not found"
            Case SE_ERR_PNF
                msg = "Path not found"
            Case SE_ERR_ACCESSDENIED
                msg = "Access denied"
            Case SE_ERR_OOM
                msg = "Out of memory"
            Case SE_ERR_DLLNOTFOUND
                msg = "DLL not found"
            Case SE_ERR_SHARE
                msg = "A sharing violation occurred"
            Case SE_ERR_ASSOCINCOMPLETE
                msg = "Incomplete or invalid file association"
            Case SE_ERR_DDETIMEOUT
                msg = "DDE Time out"
            Case SE_ERR_DDEFAIL
                msg = "DDE transaction failed"
            Case SE_ERR_DDEBUSY
                msg = "DDE busy"
            Case SE_ERR_NOASSOC
                msg = "No association for file extension"
            Case ERROR_BAD_FORMAT
                msg = "Invalid EXE file or error in EXE image"
            Case Else
                msg = "Unknown error"
        End Select
    '    MsgBox msg
    End If
    End Sub

  4. #4
    Feddy is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2016
    Location
    Space Coast Florida
    Posts
    11
    thank you! i got it to work, althought i had to modify it slightly,

    Application.FollowHyperlink Address:="http://www.dell.com/support/home/us/en/19/product-support/servicetag/" & [service tag#] & "/configuration"

    Thanks for the help!!

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

Similar Threads

  1. Replies: 10
    Last Post: 03-04-2015, 01:32 PM
  2. Inserting Data
    By dandoescode in forum Programming
    Replies: 6
    Last Post: 06-07-2012, 09:17 AM
  3. !!Please Please Help!! Inserting my Data
    By dinorbaccess in forum Access
    Replies: 9
    Last Post: 01-08-2011, 05:24 AM
  4. Inserting data through forms
    By nivi30 in forum Forms
    Replies: 1
    Last Post: 12-17-2008, 07:57 AM
  5. Inserting data in new colums
    By wasim_sono in forum Queries
    Replies: 2
    Last Post: 02-28-2006, 01:11 AM

Tags for this Thread

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