Results 1 to 13 of 13
  1. #1
    premis is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    33

    Adding "Open" column to Query Result

    I am trying to add the "open" column to my query result to provide a hyperlink to the contact details form. It shows up on my contact list but I can't get it to show up on the query list after it is run. Is this possible?

    Two pictures are attached, "Untitled-1.jpg" shows the column I want to add to my query. "Untitled-2.jpg" shows the query. And "Untitled-3.jpg" shows the form I am trying to open with the hyperlink in the open column. Of course, the hyperlink should open the record I select that was returned in the query.



    I am a fairly novice user, but can usually figure it out with a little help. Any help would be greatly appreciated.Click image for larger version. 

Name:	Untitled-1.jpg 
Views:	2 
Size:	51.5 KB 
ID:	7830Click image for larger version. 

Name:	Untitled-2.jpg 
Views:	3 
Size:	40.7 KB 
ID:	7831Click image for larger version. 

Name:	Untitled-3.jpg 
Views:	1 
Size:	107.5 KB 
ID:	7832

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I would likely use this technique:

    BaldyWeb wherecondition
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    premis is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    33
    Thanks for the quick reply pbaldy.

    It looks like I may have underestimated my skills. While some of that code looks familiar, I'm still pretty lost. Where would I put that code?

    I currently have a form (attached) that allows me to search on 7 different criteria, but one at a time. I enter the criteria into the form and hit the search button for that particular field. Each button then activates the corresponding query based on that field using this formula --Like "*" & [Forms]![SearchForm]![FirstName] & "*"---.

    So, do I put that code into the code for the search button? I am currently using a macro in the macro builder. I don't see a way to get your code in there.
    Click image for larger version. 

Name:	Untitled-4.jpg 
Views:	3 
Size:	53.3 KB 
ID:	7833

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    From the sound of it, the click or double click event of the textbox containing the value.

    http://www.baldyweb.com/FirstVBA.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    premis is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    33
    Quote Originally Posted by pbaldy View Post
    From the sound of it, the click or double click event of the textbox containing the value.

    http://www.baldyweb.com/FirstVBA.htm
    I tried using the code, but couldn't get it to work. I would really prefer to just add the "open" link to the query results table. Is there a way to do that? What about having the results come out in a form and adding the "open" link to that form?

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I can't think of a way offhand, and I think it would be more work. Do you want to post your db and we'll figure out what you did wrong?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    premis is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    33
    Quote Originally Posted by pbaldy View Post
    I can't think of a way offhand, and I think it would be more work. Do you want to post your db and we'll figure out what you did wrong?
    Sure, we can try that. I tried uploading it but the compressed file size was too big, it is over the 2mb limit. I tried hosting it at a file transfer site, hopefully this link will work. https://www.sendthisfile.com/ljsXNoaap7e7WWim7l6P3PGZ

    I forgot to mention above, and one thing that may make a difference, For the phone, e-mail, first name, and last name search boxes I am performing an "OR" query on multiple fields (ex. Phone searches "business phone" "home phone" etc..). it looked like the code didn't account for that.

    I tried placing your code in the double click event on the first name search button on the Client Search Form.

    I really appreciate the help.

  8. #8
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    More what I meant was this in the double click event of the last name field on the Client List form:

    DoCmd.OpenForm "Client Details", , , "[Last Name] = '" & Me.Last_Name & "'"

    which opens the details form to the selected record.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Or better, using the ID instead of the name, which could be duplicated:

    DoCmd.OpenForm "Client Details", , , "[ID] = " & Me.ID
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    premis is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    33
    Quote Originally Posted by pbaldy View Post
    Or better, using the ID instead of the name, which could be duplicated:

    DoCmd.OpenForm "Client Details", , , "[ID] = " & Me.ID
    That works on the client list form, it was actually already there. My problem is with the query. When I run the query to search for the first name, for example, the results are given to me in a query table format (see image untitled-2.jpg in original post). Double clicking the last name on that yields nothing, and I can't find a way to add the code to the query results.

  11. #11
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I never let users into tables or queries; you have no real control over what they do there. I would give them the results in a form. By the way, you might want to consider the search method in the sample db here:

    http://www.baldyweb.com/BuildSQL.htm

    which returns the results into a subform for the user.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    premis is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    33
    ALRIGHT! I got it! I made a form and used your code to get to the detail form.

    Thank you SO MUCH!!!! I really appreciate your help!

  13. #13
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 6
    Last Post: 07-25-2012, 06:42 AM
  2. Replies: 4
    Last Post: 01-02-2012, 11:46 PM
  3. Replies: 4
    Last Post: 12-03-2010, 04:05 PM
  4. How to change the column heading in a "split form"
    By robertrobert905 in forum Forms
    Replies: 1
    Last Post: 09-21-2010, 02:42 PM
  5. Creating "Edit Record" link in table column
    By joshearl in forum Forms
    Replies: 1
    Last Post: 12-25-2009, 11:17 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