Results 1 to 6 of 6
  1. #1
    BSJoJaMAx4's Avatar
    BSJoJaMAx4 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    48

    Able to view all records for a staff member


    I have a conference centre database with a main menu using switchboard. I have also included a tab option to view live records ie upcoming bookings in the next 7 days etc. As part of the tab option, I want the user to be able to enter a persons name in a combo box (using previous records) and it then bring up all records associated with that name.Click image for larger version. 

Name:	Print Screen.jpg 
Views:	15 
Size:	98.6 KB 
ID:	21817 As per attached, user has selected Fred, then I want to retrieve all the bookings that Fred has made (sorted by newest to oldest).

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    general query will be something along this structure

    Select * from Bookings
    Where BookingAgent = Me.[Quick Find Name]
    Order By BookingDate Descending


    Note: DATE is a reserved word in Access

  3. #3
    BSJoJaMAx4's Avatar
    BSJoJaMAx4 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    48
    Hi Orange - sorry but having one of those days. I can see how I want it to work but using your instructions cant seem to get it to work. Can you step by step me a bit (sory Im real raw with access)
    Table name is Booking Master Data
    Data for name is: Booking Officer
    Date of booking: Booking Date

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    The preference of many experienced developers is to not use a naming convention that allows embedded spaces in field and object names.

    General case:

    SELECT * FROM yourTableName
    WHERE yourFieldName = yourCriteria
    ORDER BY yourSortFeldName sortOrder

    SELECT * FROM [Booking Master Data]
    WHERE [Booking Officer]= yourCriteria
    ORDER BY [Booking Date] descending

    yourCriteria is the selected value from the combobox.

    Research techonthenet combobox

  5. #5
    BSJoJaMAx4's Avatar
    BSJoJaMAx4 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    48
    Hi Orange

    Have tried to work on this further but with no luck.

    I have created a query using the fields in the database.

    I created a form which displays the data and using a combobox to get the data from the name.

    Do I add the code
    Code:
    SELECT * FROM [Booking Master Data] WHERE [Booking Officer]= yourCriteria ORDER BY [Booking Date] descending
    in the query or the form?

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    What is the name of the combobox where Fred is located in your post #1?

    You have to enter your required value for yourCriteria in post 5.

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

Similar Threads

  1. Replies: 2
    Last Post: 01-14-2015, 12:00 PM
  2. View only specific records in form view
    By drnld in forum Access
    Replies: 5
    Last Post: 07-22-2014, 12:21 PM
  3. Replies: 3
    Last Post: 05-21-2014, 10:15 AM
  4. Replies: 5
    Last Post: 05-17-2014, 08:49 AM
  5. Cannot view all records in form view
    By thar2hag in forum Forms
    Replies: 1
    Last Post: 11-01-2012, 08:43 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