Results 1 to 5 of 5
  1. #1
    Dega is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Calgary, AB
    Posts
    73

    Getting value in subform

    Hello



    I have a main form (frmCustomers)

    Then three tabs (pages) below each with a subform.

    frmBookings
    frmRooms
    frmGroupView

    I would like the frmGroupView to grab a value (RoomGroupID) in either frmBookings OR frmRooms (where that form value is available) either with a querry or something in the querry (criteria) that points to one of the subforms.

    The purpose of this is to identify and display (frmGroupView) the members in Ms. Jones group which could be up to four records.

    I have been working the querry's but I am getting all group members (RoomGroupID & GroupName) records instead of showing just the members in Ms. Jones group. I figure if its available in either frmBookings OR
    frmRooms can I not grab it there?

    When I add something to the db criteria ([frm].[customers].[frmbookings].[roomgroupid]) I am prompted for a value and this doesn't work.

    Can anyone point me where to look ...

    Thanks

  2. #2
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317
    Dega

    I don't really understand your post, but this page might help with your last paragraph. It explains how to refer to (sub)forms from other (sub)forms.

    As for getting all records and not just those for Ms Jones, have you set the child fields and master fields?

    Remster

  3. #3
    Dega is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Calgary, AB
    Posts
    73
    Thanks Remster

    I have modified the query so I am getting the correct results.

    but ...

    I am being prompted for a "parameter value" so my syntax must not be correct?

    [Forms]![frmCustomers]![frmBookings].[Form].[RoomGroupID]

    If I enter the parameter in the database "criteria" the query works as it should giving me the correct info and correct amount of records.

    Main - frmCustomers

    tabs(3 pages)

    sub - frmBookings
    sub - frmRooms
    sub - frmRoomGroups

  4. #4
    Dega is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Calgary, AB
    Posts
    73
    SELECT tblRoomGroups.RoomGroupID, tblRooms.CustID, tblCustomers.FirstName, tblCustomers.LastName, tblRoomGroups.RoomGroupName
    FROM tblRoomGroups RIGHT JOIN (tblCustomers LEFT JOIN tblRooms ON tblCustomers.CustID = tblRooms.CustID) ON tblRoomGroups.RoomGroupID = tblRooms.RoomGroupID
    GROUP BY tblRoomGroups.RoomGroupID, tblRooms.CustID, tblCustomers.FirstName, tblCustomers.LastName, tblRoomGroups.RoomGroupName
    HAVING (((tblRoomGroups.RoomGroupID)=12));



    This query works fine with all members of a group being the output and in the above example the RoomGroupID = 12 which I entered in the db criteria for testing.

    I have a real problem trying to get this to work in a subform.

    Thanks

  5. #5
    Dega is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Calgary, AB
    Posts
    73
    Figured it out.

    This was a combination of getting the query right and pointing to the right control on the subform.

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

Similar Threads

  1. Pass Subform filter to subform in report
    By camftm in forum Programming
    Replies: 16
    Last Post: 07-19-2011, 07:12 AM
  2. Replies: 4
    Last Post: 04-07-2011, 03:39 PM
  3. Replies: 1
    Last Post: 03-15-2011, 03:53 PM
  4. Write Code to Navigate from Subform to Subform
    By Swilliams987 in forum Programming
    Replies: 22
    Last Post: 02-04-2011, 11:30 AM
  5. Replies: 15
    Last Post: 11-09-2010, 04:27 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