Results 1 to 14 of 14

Dynamically generated links not working properly

  1. #1
    rhewitt is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    74

    Dynamically generated links not working properly

    I have a report that generates links to external web pages by concatenating a base URL with a species ID. The species ID is stored in the data table, and the URL is built with the on-click event of a button.

    Example:


    Code:
    Private Sub ecosButton_Click()
    Code:
    If IsNull(Me.ECOScode) Then
        MsgBox ("Sorry, there isn't currently a species profile for " & CommonName & "."), vbOKOnly, "Warning!"
    Else
        txtURL = "http://ecos.fws.gov/speciesProfile/profile/speciesProfile.action?spcode=" & Me.ECOScode
        DoCmd.Hourglass True
        FollowHyperlink txtURL
        DoCmd.Hourglass False
    End If
    End Sub
    

    All of a sudden when I click a link it creates a URL for the FIRST SPECIES IN THE REPORT as opposed to the species that I actually selected. I'm not sure what's causing this problem as it worked perfectly before. I'm trying to attach the database, but I can't seem to get it under the 2mb size limit (I'm sitting at 2.11), and 7-zip files are not supported.

    Any suggestions?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,887
    Have you done a Compact and Repair before zipping?
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  3. #3
    rhewitt is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    74
    Compact and repair did it... I cut out all the excess unrelated to this specific problem.

    AtRiskSpeciesFinderExpot.zip

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,887
    Which Form or Report gives you the problem?
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  5. #5
    rhewitt is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    74
    Working from the Navigation switchboard, all of the reports have the problem except ​for the LCC report.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,887
    So far they all seem to be working as I would expect.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  7. #7
    rhewitt is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    74
    Hmmm... very strange. No matter which link I choose, only the code from the first record in the report is used link to an external page. If you say it's working, and I haven't changed anything then there's not much I can do.

    Thanks,
    Roy

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,887
    Hang on. I'll dig some more.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,887
    Okay, I've duplicated the issue. Now to dig in a bit.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,887
    Okay, I see the problem. How did you expect the ECOScode in the Header to reflect the ECOScode of the current record in the Detail section of the Report?
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  11. #11
    rhewitt is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    74
    OK, I thought that I just had to have the code on the form somewhere, didn't realize it had to be within the details section specifically. That makes sense!

    Thanks,
    Roy

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,887
    Easy to set it invisible and hide it behind another control in the Detail section.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  13. #13
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Glad you resolved the issue, I started poking around on it before realizing it has been resolved. Just wanted to give you a thumbs up on the form work. Looks nice. As soon as I saw that, I thought of 100 uses for a wildlife application, hunting/fishing seasons, Tag information, etc etc etc.

  14. #14
    rhewitt is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    74
    Thanks, it's my first Access project!

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

Similar Threads

  1. Checkboxes not working properly
    By TK03 in forum Access
    Replies: 1
    Last Post: 12-24-2012, 09:04 AM
  2. Login form not working properly
    By papa yaw in forum Forms
    Replies: 2
    Last Post: 12-22-2012, 09:46 AM
  3. UDF Referencing Excel Not Working Properly
    By JoeM in forum Programming
    Replies: 7
    Last Post: 09-27-2012, 12:20 PM
  4. Query on chart not working properly!
    By Sim_ in forum Queries
    Replies: 0
    Last Post: 10-28-2009, 09:38 AM
  5. How to validate dynamically generated text box
    By TheFuzzball in forum Forms
    Replies: 1
    Last Post: 10-24-2009, 10:49 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
  •  
Tech Forums: Microsoft Office Forums