Results 1 to 6 of 6
  1. #1
    gykiang is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2013
    Posts
    47

    control display of subform in single view property

    Hi all



    Is there any way to control display of subform to show only the last record ? Currently I had set the view property of both main & subform to Single & control with insertion of a page break on the subform. Unless I have only record, then it works fine with the subform embedded in the main form showing only one record, or otherwise the subform will display all records if there are more than one in continuous view though the main form remains in single view.

    The Subform has no relationship with main form with 2 fields of [ReferenceNo] and [ExecutionDate] whereas main form is conditional consisting of many filtered fields. The subform is embedded in the header of the main form. The purpose is just to show for print out of the summary form in hard copy.

    I'm not familiar with VB & will not understand the solution if in codes.

    Any clues ?

    Thanks for the assistance.

    Regards
    Kiang

  2. #2
    gykiang is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2013
    Posts
    47
    Sorry, it just strikes my mind.

    Is it possible to create a query for the subform to filter only the last record (or latest entry) of [ReferenceNo] and [ExecutionDate] ?

    If yes, what criteria to be written on the query design of either of the fields ?

    Regards
    Kiang

  3. #3
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Is it possible to create a query for the subform to filter only the last record (or latest entry) of [ReferenceNo] and [ExecutionDate] ?
    Yes, you can. Set the subform's record source to the query. Sort the query by an appropriate field so that the required record appears at the top as first record and the in query design view, change the number of records to be returned from All to 1. Alternatively, after you sort the query by an appropriate field so that the required record appears at the top as first record, switch to the SQL view and replace the SELECT with SELECT TOP 1.

  4. #4
    gykiang is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2013
    Posts
    47
    Thanks Amrut.

    Can I know how to perform this task : "in query design view, change the number of records to be returned from All to 1" ?

    Regards
    Kiang

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Open query in Design View, look at the Property Sheet, set the TopValues property to 1. This will modify the SQL statement which can be seen in SQL View.
    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.

  6. #6
    gykiang is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2013
    Posts
    47
    Thanks to all !
    I got it . That's cool... & it works exactly perfectly to what I wanted

    Regards
    Kiang

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

Similar Threads

  1. Replies: 3
    Last Post: 04-03-2014, 08:13 AM
  2. Replies: 15
    Last Post: 01-28-2014, 12:20 PM
  3. Changing control property
    By mujaqo in forum Programming
    Replies: 2
    Last Post: 05-23-2013, 09:41 AM
  4. Column Control Source Property
    By rts in forum Reports
    Replies: 6
    Last Post: 05-17-2012, 06:42 PM
  5. Report control of a field display/no display
    By systems013 in forum Reports
    Replies: 5
    Last Post: 02-01-2010, 09:44 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