Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8661319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:28:11+00:00 2026-06-12T16:28:11+00:00

I have Access form with a subform. The subform has a datasheet. The main

  • 0

I have Access form with a subform. The subform has a datasheet. The main form has drop down box and button which adds records to the subform. This all works fine (VBA code). Now I want to highlight the most recently inserted record as if I clicked on the row header.

How should I go about doing this? The main form’s combobox should still be set to the proper record at tpoint, so how do I highlight the subform record?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:28:12+00:00Added an answer on June 12, 2026 at 4:28 pm

    Make your target record the subform’s current record. Then use RunCommand to “select” it … which will also highlight the record.

    DoCmd.RunCommand acCmdSelectRecord
    

    Seems like your question is morphing into “how do I make the last added record the current record“.

    If the last added record is still the current record, then you’re there already, so no problem.

    If the user navigated to a different record after adding the last one, there are at least 2 ways to get back to it.

    1. DoCmd.GoToRecord
    2. Use a find method on the recordset clone.

    Choose the approach which best fits your situation. If the bound value of your combo box is the numeric primary key for the row last added, you can try that second suggestion like this by replacing pkey_field, YourComboNameHere, and SubformControl with the actual names you’re using.

    Private Sub FindLastRecordAdded()
        Dim rst As DAO.Recordset
        Dim strCriteria As String
    
        strCriteria = "[pkey_field] =" & Me.YourComboNameHere
    
        Set rst = Me.SubformControl.Form.RecordsetClone
        rst.FindFirst strCriteria
        If rst.NoMatch Then
            MsgBox "Oops. This shouldn't happen.", vbInformation
        Else
            Me.SubformControl.Form.Bookmark = rst.Bookmark
        End If
    
        Set rst = Nothing
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an access database with a parent form which has a subform in
I have a main form, frm_Main, and it has a subform in it, subform_Child.
I have a database created in access 2000. A form with a subform (datasheet
I have the following situation: I built an Access form with a subform (which
I have an Microsoft Access 2003 ADP, which uses a bound main form with
I have a purchase form that has a continuous subform which shows line items
I have an C# form application that use an access database. This application works
I have this select input in my form that I want to access via
I have a form in a booking system which contains a subform which is
I have an MS Access 2007 subform that is displaying data in continuous form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.