Results 1 to 15 of 15
  1. #1
    chezster1234 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    10

    button for youtube in access 2003

    Hi there I am a newby, and I have been asked by my manager to create a database for LP's (ancient i know). what i am trying to do is cretae a button that will take data out of A and B text box and put this in the youtube search bar and search automaticly. i am not sure if this can be done but would appreciate any help on this issue.



    Thanks

    James

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Are you talking about concantenating 2 text fields to create a hyperlink, so that the user can click the hyperlink and go to a specific place. Or are you talking about being able to open the youtube page and put in search criteria in their search window that is a combination of the two fields?

  3. #3
    chezster1234 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    10

    youtube

    Quote Originally Posted by rpeare View Post
    Are you talking about concantenating 2 text fields to create a hyperlink, so that the user can click the hyperlink and go to a specific place. Or are you talking about being able to open the youtube page and put in search criteria in their search window that is a combination of the two fields?
    what i am wanting is for example, text box A [meatloaf] and text box B [peice of the action]. and when i click on estimated price (button) it takes the value of text box A and B and automaticly searches for the values out of the text boxes in this case meatloaf apeice of the action and places this in the search bar on ebay and iff possible it searches automaticly

    Thanks

    James

  4. #4
    chezster1234 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    10
    i mean Ebay

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    so all of your searches are singer/group, album?

    here's an example of how to do it using excel, which can be (I haven't tried it) adapted to run from access:

    http://www.youtube.com/watch?v=7sZRcaaAVbg

    What you're looking to do is much simpler than this video you should only need about the first half of the video.

  6. #6
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    button for youtube in access 2003

    Just use some string concatenation with a replace.
    It doesn't have to be the mobile site but it's easier.

    e.g.
    Meatloaf - Bat out ...
    http://m.youtube.com/#/results?q=meatloaf%20bat%20out

    So
    Dim strURL as String
    strURL = "http://m.youtube.com/#/results?q="

    You need the textboxes:
    So
    txt1 = trim(txt1)
    'Remove trailing spaces
    txt1 = replace(txt1, " ", "%20")
    'Replace the spaces with URL encoded string i.e. %20

    Repeat for other textboxes

    Now join it
    strURL = strURL & txt1 & txt2

    In a button
    Application.FollowHyperlink strURL

    Or add a Webbrowser control to the form and
    WebBrowser1.Navigate strURL
    Last edited by AlexHedley; 05-27-2013 at 03:03 AM.

  7. #7
    chezster1234 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    10
    Quote Originally Posted by AlexHedley View Post
    Just use some string concatenation with a replace.
    It doesn't have to be the mobile site but it's easier.

    e.g.
    Meatloaf - Bat out ...
    http://m.youtube.com/#/results?q=meatloaf%20bat%20out

    So
    Dim strURL as String
    strURL = "http://m.youtube.com/#/results?q="

    You need the textboxes:
    So
    txt1 = trim(txt1)
    'Remove trailing spaces
    txt1 = replace(txt1, " ", "%20")
    'Replace the spaces with URL encoded string i.e. %20

    Repeat for other textboxes

    Now join it
    strURL = strURL & txt1 & txt2

    In a button
    Application.FollowHyperlink strURL

    Or add a Webbrowser control to the form and
    WebBrowser1.Navigate strURL
    I am having trouble understanding quite what you mean, I don't suppose you could give an explanation how to do each part please? Thanks

  8. #8
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    Post

    Do you know how to create a Form?
    Do you know VBA?
    What is your experience level?


    Steps
    Create a Blank Form.

    Add 2 Textboxes onto the Form. Grab them from the Toolbox and drag them onto the to Form.

    Click on a Textbox, bring up the Properties sheet.
    (Double click where the rulers join on the Form or Click on Property Sheet in the Ribbon)
    Rename the Textbox txt1, do the same for the other textbox, txt2.

    Now add a button to the form.
    Click on the Event Tab.
    Next to the On Click event click on the "..."
    Choose Code Builder.

    Code:
    Private Sub Command1_Click()
    
        Dim strURL as String
        strURL = "http://m.youtube.com/#/results?q="
    
        txt1 = trim(txt1) 'Remove trailing spaces
        txt1 = replace(txt1, " ", "%20") 'Replace the spaces with URL encoded string i.e. %20
    
        txt2 = trim(txt2) 'Remove trailing spaces
        txt2 = replace(txt2, " ", "%20")
    
        'Now join it
        strURL = strURL & txt1 & txt2
    
        Application.FollowHyperlink strURL 'This will open up your Default Web Browser and go to that address
    
    End Sub
    --
    Alex Hedley
    TechHelp Team Leader
    599CD.com

  9. #9
    chezster1234 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    10
    Hi there this does work however i have made a mistake in the forum i wanted it to search ebay as i am wanting a price, i have changed the url (m.youtube.com) to m.ebay.com and it does open ebay and in the url it has the data from txt1 and txt2 in the url but comes up with the home page

  10. #10
    chezster1234 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    10
    hi there i have successfully done what i wanted thank you very much for your time you deserve a medal you genious

  11. #11
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    button for youtube in access 2003

    A quick mobile search produces the following URL.

    http://shop.mobileweb.ebay.co.uk/sea...p;isNewKw=true

    You probably don't need all the query parameters for a simple search so break it down a little

    http://shop.mobileweb.ebay.co.uk/sea...atloaf+bat+out

    You will need to swap a couple of options above.

    Any spaces between search words/terms in your textboxes will need to be +.
    Swap the replace of " " with "+" instead of "%20"

  12. #12
    chezster1234 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    10

    Smile ebay lp

    Quote Originally Posted by AlexHedley View Post
    A quick mobile search produces the following URL.

    http://shop.mobileweb.ebay.co.uk/sea...p;isNewKw=true

    You probably don't need all the query parameters for a simple search so break it down a little

    http://shop.mobileweb.ebay.co.uk/sea...atloaf+bat+out

    You will need to swap a couple of options above.

    Any spaces between search words/terms in your textboxes will need to be +.
    Swap the replace of " " with "+" instead of "%20"
    brilliant thank you also as an add on could i have it so it searches on the end of txt1 and txt b with "lp" as it is designed to find prices for lps

  13. #13
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    button for youtube in access 2003

    Yeah if you want it to always search for an LP.
    After you have added all your textboxes together add
    Code:
    strURL = strURL & "+lp"
    Then the Application.follow ...

  14. #14
    chezster1234 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    10

    Smile great thanks

    Quote Originally Posted by AlexHedley View Post
    Yeah if you want it to always search for an LP.
    After you have added all your textboxes together add
    Code:
    strURL = strURL & "+lp"
    Then the Application.follow ...

    Hi there thanks for the advice and guidance you have helped me allot 10 out of 10

  15. #15
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180
    Thanks,
    If you are happy to you can add Reputation by clicking the star under a post.

    There is also the option to mark the Thread as Solved by clicking on the "Thread Tools" then "Mark this thread as solved…" at the top right of a post.

    Alex

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

Similar Threads

  1. Replies: 2
    Last Post: 08-10-2012, 12:28 AM
  2. Export from Access 2003 to Excel 2003 - missing fields
    By Jack Sheet in forum Import/Export Data
    Replies: 1
    Last Post: 02-29-2012, 04:09 PM
  3. embedding youtube clip into access forms-is it possible?
    By ymds in forum Import/Export Data
    Replies: 1
    Last Post: 06-12-2010, 10:37 AM
  4. Replies: 3
    Last Post: 06-10-2010, 03:24 PM
  5. Replies: 1
    Last Post: 09-06-2006, 11:48 AM

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