Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    scoobz1234 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    41

    creating buttons to view a contact file help

    Good Evening,



    I have recently began using Access, and i have created a database that has what i call user "Profiles" or contact information for around 63 people. What i'd like to do is set up a form or a Report that has buttons with maybe pictures or just a persons name, when its clicked it opens up their "Profile" which shows a picture and all their information. is this possible? if so, could anyone posibally point me in the correct direction. thanks for any help!!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,604
    Review this about storing or referencing image files http://office.microsoft.com/en-us/ac...005280225.aspx

    Access 2007 introduced the ControlSource property on the Image control. Save the file name in a text field or image in an attachment field, bind control to the field, and the image displays. Some image types not supported. PDF's won't display.

    Now build a form or report to display the data from table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    scoobz1234 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    41
    i can get the buttons to open a form, but i cant get them to open a specific record in the form

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,604
    I usually use the WHERE CONDITION argument of DoCmd.OpenForm (or OpenReport)

    Have a text or combobox on form to select filter criteria.

    Then code (I use only VBA): DoCmd.OpenForm "formnamehere", , ,"ID=" & Me.textboxnamehere

    Here is another way to filter form: http://datapigtechnologies.com/flash...tomfilter.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    scoobz1234 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    41
    Thanks for the information, i did somewhat like you said, i created a txt input box made it invisible set the default to a name like bob, then created a button that opened the form record using [last name]=[forms]![form1][txtinput] ...this way when you press the button it opens that persons profile, so i can create each button to open a specific profile...only issue is.. its tedious and time consuming to create a button for each person, my database is massive and has over 300 people in it.

    i have a form where i input the personnel's information, i was thinking i could add a button to the bottom that "Saves" the profile, and maybe at the same time creat the button either using VB or maybe a macro? whats your thoughts on that?

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,604
    The code should reference control that is bound to field of form's recordsource. The code will take the ID value from whatever record has the focus. This allows dynamic referencing to open the individual's profile.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    scoobz1234 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    41
    i have a blank form that just has buttons in it, each button opens a specific record from another form. i fear you have lost me with your last post haha.


    edit: at home with 2010 version i can create a button that searches specific data and i can just use a text box to search a name. not quite what i wanted in the long run but it works. but at work with 2007 i get an error about the form not being linked...how do i fix that?

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,604
    Oh, the form only had buttons and is not bound to records. Why would buttons open specific record? I don't know why 2007 would act differently from 2010. Do you want to provide project (make copy and remove confidiential data)?

    Okay, need to input search criteria somewhere. Review this tutorial http://datapigtechnologies.com/flash...tomfilter.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    scoobz1234 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    41
    the file was too big for the site so i uploaded it to 4shared, the two forms that i left in the database are the main one i use to input the profile information, and then the second one is the search one i made, the third named tester is what im Trying to accomplish this whole time... Personell Database.accdb

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,604
    Good start! I hope you intend to abandon the 'Tester Form' approach. I suggest you consider these options:

    1. One form to show existing data, add new data, search for records. This concept is described in the link I referenced earlier.

    2. Two forms as you already have. I suggest a combobox with a RowSource of valid choices. Combobox properties:
    RowSource: SELECT ID, [Last Name] & ", " & [First Name] & " " & [MI] AS StaffName FROM [Recall information] ORDER BY [Last Name], [First Name], [MI];
    ColumnCount: 2
    BoundColumn: 1
    ColumnWidths: 0";2"
    LimitToList: Yes
    AutoExpand: Yes

    Change the macro to open record on specific ID, not name. I named the combobox cbxStaff:
    [ID]=[Forms]![Search Form]![cbxStaff]

    The search button macro is referencing a form not included in the project.

    If you use this method to open Recall form, the record navigation buttons will be meaningless as the form is open to only one record.

    Other suggestions.
    Eliminate the search button and use AfterUpdate event of the combobox.
    Label set with Sunken effect makes it look like a data entry box, change to Flat.
    Use the combobox NotInList event to handle typed input that is not in the list. User can be offered choice to enter new staff record.
    Avoid spaces and special characters and punctuation (underscore is exception) in any names or reserved words as names. Better would be LastName or Last_Name. If used must remember to enclose in []. Access will try to supply the [] when needed but sometimes can be confused.
    Recall form opens with focus on First Name. Might want to modify TabOrder property of controls.
    A single & can be used to define a shortcut key on a button. Any character following the & can be pressed with Alt key to execute the click event. Like: Save && &Close - press Alt+C. If a form doesn't have any data controls, such as menu form with only buttons, don't even need the Alt.

    BTW, zipped file would have been small enough to attach to post.
    Last edited by June7; 03-17-2012 at 01:30 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    scoobz1234 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    41
    Ok so a few things.... I changed some stuff around, abandoned some ideas i REALLY wanted to do for interface looks... fixed some stuff you had mentioned about, i ziped a file into a .rar and the site said its not the right type of format... so again here is a 4shared link Personell Database.accdb

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,604
    Windows Compression zip up to 2mb can be attached.

    Like your mods.

    The search criteria requires an exact match. Any slight misspelling will not find record. Consider a combobox with row source of valid choices. Then do search on ID field instead of last name so will get the exact record desired, not all the Jones or Smith. The combobox RowSource could be multicolumn like:

    SELECT ID, LastName & ", " & FirstName & " " & MI & " " Rank AS personnel FROM Recall_Information ORDER BY LastName & ", " & FirstName & " " & MI & " " Rank;
    Set ColumnWidths as 0";2"

    Tab order still seems awkward.

    You show two records for Bryan Preston. Was that intentional?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    scoobz1234 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    41
    i made a tester form with the drop down box like that, its ok its not that bad. i need to make this as user friendly as possible. i was looking at templates and the WEB template on there didnt look too bad, it opens up to a form and there are tabs that you can click through to do different things..

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,604
    You are possibly describing a tab control. Yes, I find it quite handy at times to organize a form with lots of controls. Can even put subforms on the pages of tab control.

    Access 2010 has a new Navigation form that also uses a tab structure, but I haven't used it yet. It's really a wizard tool and I avoid the wizards.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    scoobz1234 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    41
    Mals-14 Trianing Db.zip Would you like to see the project so far?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Creating Buttons on a form keeps returning a visual basic error
    By Robin Banks in forum Database Design
    Replies: 1
    Last Post: 02-28-2012, 07:48 AM
  2. Creating subqueries in SQL view
    By AmyM in forum Queries
    Replies: 2
    Last Post: 11-20-2011, 05:21 PM
  3. Creating FILTER Buttons
    By Kipster1203 in forum Forms
    Replies: 9
    Last Post: 06-17-2010, 09:31 AM
  4. Creating Sort Buttons in a Header in a list view
    By marttaaayyy!! in forum Programming
    Replies: 4
    Last Post: 03-29-2010, 11:08 AM
  5. Access 2003 - Creating Buttons from a Table
    By Speedy in forum Programming
    Replies: 2
    Last Post: 02-28-2009, 05:32 PM

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