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 649599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:57:42+00:00 2026-05-13T21:57:42+00:00

So I have an unbound form that I use to save data to a

  • 0

So I have an unbound form that I use to save data to a table on button click.

Is there a way I can have subforms for entry that will allow me to save data to the table within that same button click? Basically I want to add more entry options for the user, and while I know other ways to do it, I am particularly curious about doing it this way (if it can be done).

So lets say the ‘parent form’ is frmMain. And there are two child forms “sub1” and “sub2”. Just for example sake lets say on frmMain there are two text boxes: txtTitle & txtAuthor.
sub1 and sub2 both have a text Box on them that represent something like prices. The idea is Title & author of a book, and then a price at each store (simplified).

So I tried this (because I thought it was worth a shot):

Dim db as DAO.database
Dim sql as String


sql = "INSERT INTO (Title, Author, PriceA, PriceB) VALUES ("

if not isnull(me.txtTitle) then
    sql = sql & """" & me.txtTitle & ""","
Else
    sql = sql & " NULL,"
End If

if not IsNull(me.txtAuthor) then
    sql = sql & " """ & me.txtAuthor & ""","
else
    sql = sql & " NULL,"
end if

if not IsNull (forms!sub1.txtPrice) then
    sql = sql & " """ & forms!sub1.txtPrice & ""","
else
    sql = sql & " NULL,"
end if

without finishing the code, i think you may see the GOTCHA i am headed for. I tried this and got an “Access cannot find the form “” “. I think I can pretty much see why on this approach too, because when I click the button that calls the new sub form into the parent form, the values that were just entered are not held/saved as sub1 closes and sub2 opens.
I should mention that the idea above is not intended to be a one or the other approach, rather both sub forms used everytime.

so this is an example. i want to use this method (if possible) to have about 7 different sub form choices in one form, and be able to save to a table via a SQL statement.

I realize that there may be better ways, but I am just wondering if I can get there with this approach out of curiousity.

Thanks as always!

  • 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-05-13T21:57:42+00:00Added an answer on May 13, 2026 at 9:57 pm

    Your problem is with how you are referring to the controls, instead of

    forms!sub1.txtPrice

    try

    me!sub1.form.txtPrice

    You can see more example of how to refer to sub forms here

    http://www.mvps.org/access/forms/frm0031.htm

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

Sidebar

Related Questions

No related questions found

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.