New record on subform of subform (1 Viewer)

alcifer_c

Registered User.
Local time
Today, 10:59
Joined
Jun 3, 2002
Messages
42
Yes it is complicated...

Ok, I have a form which displays some records in a multi select listbox.
User will select the records they want, click a button and the records are transfered to a subform's subform. The relationship is that one selection from the main form will be one entry in the subform's subform (continuous)....3 items from the multi select listbox, equals 3 continuous forms after click.
The first subform btw, contains a control number which is the parent to all the subs.
Basically, the user will be generating a type of trouble ticket based on the items in the listbox.

here's the rub.
I have been succesful at getting 1 item from the listbox onto the sub-subform, but no more. The action I'm using to accomplish this is a loop which looks at each itemselected, and puts the values I want. As things stand right now, if 4 items are selected, only thr 4th one gets written to the sub subform, which means that the loop is working, however my attempts with docmd.gotorecord acdataform, "me.subformA.form!subformB", acnewrec and many other variants of the form name only result in the error message "Object is not open". BUT IT IS... So, after reading posts, I successfully changed set the focus to a field within subformB before attempting to get to a new record but it just isn't working.

Please help. I've been at this all day... seems like it should be so simple.

many thanks, al
 

WayneRyan

AWF VIP
Local time
Today, 10:59
Joined
Nov 19, 2002
Messages
7,122
al,

Hard to troubleshoot code without seeing it. Can you post a sample?

Tools --> Database Utilities --> Compact/Repair
ZIP
Then attach

Wayne
 

DB7

Registered User.
Local time
Today, 02:59
Joined
Aug 21, 2004
Messages
138
Al,

I don't have the time right now, to consider specifically, whet you're attempting...DoCmd.GoTo Record acNewRec.

..but, I would suggest possibly, An INSERT INTO SQL?

While values from listbox, are been extracted, Run SQL...

For x = 0 To lstBox.ListCount - 1
If lstBox.Selected(x) = True Then

DoCmd.SetWarnings = False
DoCmd.RunSQL "INSERT INTO tblTable1(Field1) VALUES("'" & lstBox.ItemData(x) & "'")
DoCmd.SetWarnings = True

Next x

Just an idea, Hope this helps.

Either way, Good Luck!
 

Users who are viewing this thread

Top Bottom