Results 1 to 5 of 5
  1. #1
    Sgt_Utz is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2017
    Posts
    25

    Returning path from 2nd record?

    I am building a customer database with a dedicated spot on the bottom of a customer form to display 3 pictures left to right. Some customers don't have any pictures, while most have 1-3.

    Under the expression builder for each of the pictures i'm trying to create a SQL query to find the pic if it exists to string the path to the pic. Using the example below, the query sorts the "ID" field ascending (easy), but for the middle (2nd) picture in the form I need to string the "path" from record 2166 (2nd record in the results).


    Click image for larger version. 

Name:	Records.png 
Views:	15 
Size:	16.1 KB 
ID:	45227

    I'm sure this is easy but I've been looking for a while with no success.

    Thanks all!

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,936
    I'd probably create a function to get all three and populate an array to hold the paths?

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Would be much easier if you would create a subform that would display the pictures (linked by Customer_ID), that way you could accommodate the odd customer with 4 (or 5...) pictures.

    To do it the way you have it you would probably have to write a custom VBA function in which you would move through a recordset one record at the time and get the path. Or maybe create SQL queries grouping by customer_ID and use Min(ID) to get first record, Max(ID) the get the third and (<>Min(ID) AND <>Max(ID)) to get the second.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    on the form , when the user pulls the master record for cust: CUS-000-0983, (single rec)
    the subform will pull the 3 photo records. (datasheet)
    user can then select the one wanted , then click another button to open it.

    databases don't display records left-to-right. (only top/down)

  5. #5
    Sgt_Utz is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2017
    Posts
    25
    Thanks for the suggestions. This is actually a database to show the current data from some software. I need to build it first to see everything, then design a database to transition from the current software. I found customers only had 3 pictures max, so that's why i just wanted to be able to see them all displayed so i could see what each customer has and go from there.

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

Similar Threads

  1. Replies: 8
    Last Post: 10-12-2020, 01:19 PM
  2. Replies: 2
    Last Post: 08-22-2018, 12:15 PM
  3. Query not returning a record it should
    By robbeh in forum Queries
    Replies: 10
    Last Post: 06-24-2015, 12:53 PM
  4. Replies: 6
    Last Post: 05-27-2014, 05:41 AM
  5. record set not returning rows
    By lvmoore in forum Forms
    Replies: 3
    Last Post: 09-25-2010, 10:48 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