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

  • SEARCH
  • Home
  • 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 8465213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:58:38+00:00 2026-06-10T14:58:38+00:00

So, I have a MS Access database application. In this application is a main

  • 0

So, I have a MS Access database application. In this application is a main form, which contains a number of subforms. One form in particular has a drop down box that I populate with dates from a database query. When one of these dates is selected, I run a subroutine that is supposed to update a recordset on the subform with history information. Below is some edited code (just removed the large number of fields from the queries)

Private Sub pickdate_AfterUpdate()
'''''''''''''''''''''''''''''''''''''''''
'   Add review history by selected date
'''''''''''''''''''''''''''''''''''''''''
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT model, entered_date FROM history WHERE entered_date=#" & Me.pickdate.value & "# ORDER BY model DESC", dbOpenDynaset, dbSeeChanges)

If rs.BOF = False Then rs.MoveFirst
While rs.EOF = False

    Forms!main!histories.Form.Recordset.AddNew
    Forms!main!histories.Form.Recordset![model] = rs![model]
    Forms!main!histories.Form.Recordset![entered_date] = rs![entered_date]
    Forms!main!histories.Form.Recordset.Update

    rs.MoveNext
Wend
End Sub

I get the error on the Forms!main!histories.Form.Recordset.AddNew line.

I have tried the following versions of that line:

Forms!main!histories.Form.Recordset.AddNew
main!histories.Form.Recordset.AddNew
histories.Form.Recordset.AddNew
Me.Form.Recordset.AddNew
Me.Recordset.AddNew
Me.AddNew
Me.main!histories.Form.Recordset.AddNew
Me!histories.Form.Recordset.Addnew
Me!main!histories.Form.Recordset.AddNew

I am literally at my wit’s end trying to figure out where the issue is.
The subform has all the proper boxes to store the information. I have given them labels to match their database columns that will go into them. I’ve tried setting their control sources to the database column names and not setting them to anything. I’ve looked up a hundred different “solutions”, none of which seem to either fit the problem or work.

I feel like I am overlooking something really easy.

  • 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-10T14:58:40+00:00Added an answer on June 10, 2026 at 2:58 pm

    I reckon you have problems with your names. Check all of them. Do not forget that a subform consists of two parts, the subform control and the form contained. These often have the same name, but not always. In the code you are using, you must have the name of the subform control, not the form contained. If entering data into the subform manually is not working properly, your controls are not bound.

    This works for me on a sample table.

    Dim rs As Recordset
    Set rs = CurrentDb.OpenRecordset("SELECT atext from table1 WHERE akey=21")
    
    If rs.BOF = False Then rs.MoveFirst
    While Not rs.EOF '= False
        Me.Table1_subform1.Form.Recordset.AddNew
        Me.Table1_subform1.Form.Recordset!AText = rs!AText
        Me.Table1_subform1.Form.Recordset.Update
    
        rs.MoveNext
    Wend
    

    To run a query you could say:

    sSQL="INSERT INTO NameOfTable (model, entered_date) " _
    & "SELECT model, entered_date FROM history WHERE entered_date=#" _
    & Me.pickdate.value & "#"
    
    CurrentDB.execute, dbfailOnError
    

    You can check the sql works in the query design window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an C# form application that use an access database. This application works
In an application we are developing, I have access to a database table which
I have an Access application which use SQLServer 2008 R2 as database. When I
I have a whole slew of database access functions which assume a particular connection
I have created an TCPip server application. The application has one global TADOConnection. This
I have an old compiled Access Application mde file. This application has linked tables
Currently I have one application in which I am able to access .mdb or
Hi I have an application which after login, loads a main activity which contains
I have an Microsoft Access 2003 ADP, which uses a bound main form with
I have developed an database application with Delphi XE2 using an Access DB, now

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.