Adding Records to Hidden Form

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I need to add records to a subform on a hidden form, but I can't get the
subform to go to a new record. The GOTO Control doesn't work because
it's hidden. I tried Goto NewRecord,Forms!MainForm.Subform,acNewRecord
but that doesn't work either.
Thanks
DS
 
I need to add records to a subform on a hidden form, but I can't get the
subform to go to a new record. The GOTO Control doesn't work because
it's hidden. I tried Goto NewRecord,Forms!MainForm.Subform,acNewRecord
but that doesn't work either.
Thanks
DS

Records are not stored in Forms. They're stored in Tables.

To add records to a table (whether that table is bound to a visible
form, a hidden form, or no form at all) you can use an Append query,
or you can open a Recordset based on the form and use the AddNew
method.


John W. Vinson[MVP]
 
John said:
Records are not stored in Forms. They're stored in Tables.

To add records to a table (whether that table is bound to a visible
form, a hidden form, or no form at all) you can use an Append query,
or you can open a Recordset based on the form and use the AddNew
method.


John W. Vinson[MVP]
Thanks John,
How do yo run an Append Query from a listbox?
DS
 
Thanks John,
How do yo run an Append Query from a listbox?
DS

There are a couple of ways; I'd recommend using VBA code in the
listbox's AfterUpdate event. Could you explain how the user will be
using the listbox, and where the new records should come from?

John W. Vinson[MVP]
 
John said:
There are a couple of ways; I'd recommend using VBA code in the
listbox's AfterUpdate event. Could you explain how the user will be
using the listbox, and where the new records should come from?

John W. Vinson[MVP]
They will be picking products from a listbox that comes from a query
based on 4 Tables Menus, Items, SalesDetails and DiscountTypes the query
is called SalesDetailsQ.
Thanks
John
 
They will be picking products from a listbox that comes from a query
based on 4 Tables Menus, Items, SalesDetails and DiscountTypes the query
is called SalesDetailsQ.
Thanks

Sorry, but that doesn't help me much. What are you appending? To what
table? It SOUNDS like you may be storing a lot of data redundantly but
it's impossible to tell what you're trying to store, where you're
getting it, and where you want it stored.

John W. Vinson[MVP]
 
John said:
Sorry, but that doesn't help me much. What are you appending? To what
table? It SOUNDS like you may be storing a lot of data redundantly but
it's impossible to tell what you're trying to store, where you're
getting it, and where you want it stored.

John W. Vinson[MVP]
I'm appending new orders with products to the salesdetails table.
DS
 
I'm appending new orders with products to the salesdetails table.
DS

Then create an Append query selecting the data from wherever it should
come from (which you haven't told me) to the appropriate fields in the
salesdetails table (which you haven't told me either), and execute the
query.

John W. Vinson[MVP]
 
John said:
Then create an Append query selecting the data from wherever it should
come from (which you haven't told me) to the appropriate fields in the
salesdetails table (which you haven't told me either), and execute the
query.

John W. Vinson[MVP]
OK John, I've got it now...sometimes it takes a little pounding to get
through. It probably came from the lack of understanding the append
query thing to begin with. This won't work, what I need to do, or want
to do is add a new record to a query, not append. I was hoping to use
this method instead of having a subform. I thought I could just run SQL
from the listbox on click and add the new records to the Query. Does
this make sense?
Thanks
DS
 
Back
Top