473,287 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Access2000 data Entry Unbound Form With Subform

Have main form with an unbound subform1 which is used for data entry.
Subform1 has a nested continuous unbound subform (subform2) which is used to
enter multiple records related to the record being entered in subform1.

Am using DAO method to save the records entered into subform1 & 2 into the
underlying tables (table1 & table2).

Record being entered in subform1 only gets its unique identifier when saved
to underlying table (primary key field is autonumber).

Any suggestions on best way to set up saving the related records in table2
(i.e. get the key field from the related record being saved in table1).
Prefer user to enter data in subform1 & 2 in one step and then press a save
button which will save the record to table1 and the related records to
table2.

Any suggestions greatly appreciated.

Bob
Dec 21 '05 #1
4 2692
Hmm. Can you get the subsubform to generate more than one record? I
would think that you wouldn't be able to move to a second record there
if you're not saving the data somewhere (though I'm not sure of this).
If that's the case, you've got to look for some funky workaround.

One thought, which is probably how it would be done in a lot of other
programming languages, where there's no such thing as a bound form:
Make an array to store the data from the subsubform. Build a group of
controls that _looks like_ a continuous form, including navigation
buttons, which will have to shuffle data into and out of different rows
of controls, depending on what's in the array.

Then, when it's time to save all this, you save what's in the subform,
grab that ID value, and use that when you save the data from the array
into a table.

I did this for a form once, it's a bunch of work, but it's nothing too
complex. If you're going to do this, I would definitely suggest you
sketch out every ounce of code first--there are a bunch of operations
involved, and you'll want to abstract as much of it as possible, so you
can reuse as much code as possible.

I'll look for that code now, but I'm guessing it's long gone.

Jeremy

Dec 21 '05 #2
Had similar problem, couldn't save records on SF2, because ID was missing.
Work around was to save SF1 onENTER SF2.
Jan 2 '06 #3
Robert <ro*******@bigpond.com> wrote:
: Have main form with an unbound subform1 which is used for data entry.
: Subform1 has a nested continuous unbound subform (subform2) which is used
: to enter multiple records related to the record being entered in subform1.

<snip>
: Any suggestions on best way to set up saving the related records in table2
: (i.e. get the key field from the related record being saved in table1).
: Prefer user to enter data in subform1 & 2 in one step and then press a save
: button which will save the record to table1 and the related records to
: table2.

I just posted code to a thread called 'Year Numbers' that
needed to know the next autonumber that would be generated for
a table's primary key:
dim oMax as string
oMax = "ID DESC" 'Order by for Allen Browne's Elookup fn.

' This is the next autonumber that will be generated for field ID.
IDnext = Elookup("ID","PurchaseOrders", ,oMax) + 1

oMax forces the lookedup list to be sorted in descending order, so
when Elookup returns the first item in list, that number is the last
autonumber so far assigned; I add 1 to get the next number to be
assigned.
You can make this lookup each time you open subform1, and each time
you insert a subform1 record increment its value. Then you need to
make its value available to the subsubform as either a global
variable or one of these properties I haven't really learned to use yet.

You'll need to get the Elookup function from Allen Browne's website:
it's an extension that he wrote and makes freely available.
I found it using google.

: Any suggestions greatly appreciated.

: Bob
Jan 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JH Higgins | last post by:
In Access (.mdb File) I have a subform on a form. Doing data entry on the subform works just fine. If I move the forms and tables over to a .adp I can no longer do data entry in the child...
3
by: Carmela | last post by:
Hello Readers, I am trying to update data on a form that is based on a query having a many-to-one-to-many relationship. I found this exciting link that seemed to have the solution for me: ...
5
by: lottaviano | last post by:
I am using Access 2002 and have two tables (Main and Actions) linked (in Relationships) on one field "CAL_ID" (primary key in Main Table). Main Table is a list of equipment. Actions Table lists...
4
by: MLH | last post by:
On a data entry only form. lets say a user opens your form and enters 4 consecutive records. Each time, he clicks your SAVE button and a record is save and the record set is advanced to a newrec. ...
2
by: badboybrown | last post by:
Good afternoon, Please can someone tell me the best way of calling up a form that will allow the user to only add new records. I have other forms that will be used to view the existing...
1
by: lesperancer | last post by:
I've got a form that is opened in readonly mode and no fields can be changed, great but if I click on a combo box that has an _enter() event that sets a field on my form to a value (albeit the...
1
by: BlackFireNova | last post by:
I'm using Access 2003, on Windows XP Pro. I have a subform which is launched from a command button on my main form. When this form opens, I have 2 fields which I have inserted VBA Code into to...
7
reginaldmerritt
by: reginaldmerritt | last post by:
I have a few forms which i have designed to be subforms to a mainform that has no fields or record source. The forms have an unbound textbox and combo box, which i use to seach the data on these...
6
by: Elizabeth Mitte | last post by:
I have a database with multiple tables, all interlinked via referentially enforced relationships between pks and fks. I am attempting to produce forms which will allow the user to enter data that...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.