Results 1 to 15 of 15
  1. #1
    asmith533 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    13

    Issues with subform and master form


    Have a form "Update customer request" in my database. Within that form, I have a control drop down that contains employee names. Within my sub form, I have 3 fields: Assigned to, received by and collaboration with. How do I get my control drop down to display records for that employee whether they received it, assigned it or were part of the collaboration?

  2. #2
    smithse is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    37
    Hi asmith533,

    Which 'form' is the source of your combo box data? Do you wish to see the employee names as a list (i.e. 3 names) from the subform, or update the subform based on the combo box selection on the parent form? It sounds like the former.

  3. #3
    asmith533 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    13
    Quote Originally Posted by smithse View Post
    Hi asmith533,

    Which 'form' is the source of your combo box data? Do you wish to see the employee names as a list (i.e. 3 names) from the subform, or update the subform based on the combo box selection on the parent form? It sounds like the former.
    The source of the combo box is my employee table. The Employee ID in the employee table is used to populate the three fields mentioned above. I want to be able to update the subform based on the combo box selection in the parent form.

  4. #4
    smithse is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    37
    Quote Originally Posted by asmith533 View Post
    The source of the combo box is my employee table. The Employee ID in the employee table is used to populate the three fields mentioned above. I want to be able to update the subform based on the combo box selection in the parent form.
    So, if I understand correctly, your combo box might have 10 employees, but you select one to fill the fields in the combo box below. If this is correct, then do you have another combo which chooses whether they were the Assigned To, Received By or Collaboration person, or is that one person all of those three fields?

    Sorry if that confuses things, I am trying to understand what you want to achieve.

    If it was me, I would be selected what the person was, i.e. the collaborator, receiver or assignee and then selecting the person. From there I would update the backend table and refresh the form to display the changes.

    Let us know, and I am sure we can find a solution!

  5. #5
    asmith533 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    13
    Well, the employees using this database want to be able to see and update any and all requests they played a part in. They also want to do it in as few clicks as possible. (There is a submit customer feedback button that they hate as well and want to get rid of and have the fields show up on the request form, whole other issue I'm not sure I'm going to address yet). Back to the topic... The employees are asking that they be able to select their name from the drop down list and all requests associated with their name appear.

  6. #6
    smithse is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    37
    Oops, please excuse the double post.

    So here goes another question: from your 'main form' or parent form, how many records are you displaying in your subform? If it is more than one, it gets 'ugly' if they want to do it in as few clicks as possible. If it is only one, then probably not so bad.

    I am sure you can understand the reason behind me saying that you need to have a way of selecting which field the name goes into.... If it is all three fields, then is easier again, but if not, they will need to choose.
    Last edited by smithse; 09-21-2012 at 08:48 AM. Reason: duplicate post

  7. #7
    asmith533 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    13
    The combo box in the parent form is being used as a filter, not to populate the fields. So if Employee J wanted to see all the requests he was involved with for the quarter, he would select his name in the parent form and all his requests would appear in the subform. Or if Employee K wanted to update a request she had worked on but was unsure of the request number, she could select her name on the parent form and all the requests she was involved with would appear. Does that make sense? The database is split so the user has a front end and all the data resides on the back end. The database they currently use has no switchboard or forms, they just directly manipulate the tables.

  8. #8
    smithse is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    37
    Ok, we are getting somewhere... LOL
    I now understand what you're trying to do, and it maes sense. It's easy enough in a form to create a filter for a subform. One way to do it is to base the subform on a query which takes a parameter value from the combobox on the 'parent form'. The parent form doesn't need to be be bound to a table either.
    There are a few ways to design your queries too. You could have a query which has the employee combo box providing the filter or parameter value to all three fields, or you could have 3 combox boxes, one for each.
    I am picking a single combo box to display all three different categories.

    If for example you want to display all requests that an employee had anything to do with, regardless of their part in the process (i.e. receiver, collaborate, assigned) then your query could be something like this:

    SELECT Requests.AssignedTo, Requests.ReceivedBy, Requests.Collaborated
    FROM Requests
    WHERE (((Requests.AssignedTo)=[Forms]![Form1]![Combo0])) OR (((Requests.ReceivedBy)=[Forms]![Form1]![Combo0])) OR (((Requests.Collaborated)=[Forms]![Form1]![Combo0]));

    Also, I take it that you're building a front-end forms application for this db...?

  9. #9
    asmith533 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    13
    Yes, I have all my tables built and I have several forms/reports/queries built. I have the database set up to where all the employee sees is the switchboard. They select what they want to do from that.

  10. #10
    asmith533 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    13
    With this query, can I build it in the form? Also, do I still need the parent child relationship?

  11. #11
    smithse is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    37
    It depends if your parent form is displaying data from a record, or 'bound' to a record in a table or query. If it is not, and is simply housing the controls (your comboboxes) which you're using to filter the subform, then no, it doesn't have to be a parent-child relationship.

  12. #12
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    A simpler way is to link the main form combo box with the subform on the employee id. Then when you change the combo box the subform will show all records with that employee id. If the subform is based on a table then all records in that table for that employee will show on the subform. I advise basing the subform on a query that allows you to specify specific criteria other than the employeeid for example get all records with a status of open or maybe closed depending on what you want. You could also specify a date range say where Year(opendate) = Year(now()) gets all of the current year records or yada yada yada. However be advised that if the query is non-updateable and you want them to be able to edit the information on the subform you will have to provide a save routine.

  13. #13
    smithse is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    37
    Quote Originally Posted by RayMilhon View Post
    A simpler way is to link the main form combo box with the subform on the employee id. Then when you change the combo box the subform will show all records with that employee id. If the subform is based on a table then all records in that table for that employee will show on the subform. I advise basing the subform on a query that allows you to specify specific criteria other than the employeeid for example get all records with a status of open or maybe closed depending on what you want. You could also specify a date range say where Year(opendate) = Year(now()) gets all of the current year records or yada yada yada. However be advised that if the query is non-updateable and you want them to be able to edit the information on the subform you will have to provide a save routine.
    Yes, definitely the way to go, although the employeeid could be in 3 different fields in this case, hence my suggestion.

  14. #14
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    You're right. I apparently left my brain at home this morning. it does specify it could be any of the 3 different fields. your suggestion definitely the way to go in this case

  15. #15
    asmith533 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    13
    So here is my query string as it applies to my databse. Is this right?

    SELECT Tbl_Requests.TblRequests_AssignedTo, Tbl_Requests.TblRequests_ReceivedBy, Tbl_Requests.TblRequests_Collaboration
    FROM Tbl_Requests
    WHERE ((([Tbl_Requests].[TblRequests_AssignedTo])=[Forms]![Frm_UpdateCustomerRequest2]![Combo4])) OR ((([Tbl_Requests].[TblRequests_ReceivedBy])=[Forms]![Frm_UpdateCustomerRequest2]![Combo4])) OR ((([Tbl_Requests].[TblRequests_Collaboration])=[Forms]![Frm_UpdateCustomerRequest2]![Combo4]));


    Also, where do I post this Query string to make it work on my form?

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

Similar Threads

  1. Form SubForm Issues still
    By kathi2005 in forum Forms
    Replies: 4
    Last Post: 11-07-2011, 01:10 PM
  2. subform to open form w/ active master record
    By spitfire122 in forum Access
    Replies: 1
    Last Post: 06-28-2011, 04:28 PM
  3. Replies: 2
    Last Post: 06-14-2010, 03:25 PM
  4. Replies: 0
    Last Post: 12-16-2009, 01:14 PM
  5. Subform Issues
    By dromorkid in forum Forms
    Replies: 0
    Last Post: 11-24-2008, 11:35 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