I'm lost with this... (I hope someone can help me)

  • Thread starter Thread starter rick
  • Start date Start date
R

rick

Hi all, I'm new and am very frustrated. I hope someone out there ca
answer this.

I have a form with about 10 unbound text boxes and about 20 optio
groups with 3 radio buttons each (yes, no, n/a). The text boxes,
just have the user enter in stuff, no biggie there... When the use
clicks on a "no" radio button (all are defaulted to "yes"), I have i
opening a subform that just has one text box, where the user will ente
in some more notes that will be added to the same record in th
database (subform closes when they are doen with it).

So here's what I thought would work (of course it doesn't):
1. On the main form's form_load section have a new record adde
(rst.Addnew)
2. Have them fill in the text boxes (validate them of course)
3. If a "no" button is selected, open the subform, accept the text an
edit the newly added record with this text (rst.Edit)
4. When all is done, have them click on Submit on the main form and i
they accept it, it would them update the record (rst.Update).

The problem is when the subform "edits", it just edits the first recor
in the table (it's like the rst.addnew code in the form_load i
ignored... because it does not add a new record). when it gets down t
the submit button code (main form), it blows up since I don't have th
rst.Addnew code there (remember, I thought I would put it in th
form_load section. I can't see how I can put it in the submit_butto
section and still capture the comments and put them in the same ne
record.

sorry to be so lengthy.. just seeing if someone wanted to tackle this
 
Hi all, I'm new and am very frustrated. I hope someone out there can
answer this.

I have a form with about 10 unbound text boxes and about 20 option
groups with 3 radio buttons each (yes, no, n/a). The text boxes, I
just have the user enter in stuff, no biggie there... When the user
clicks on a "no" radio button (all are defaulted to "yes"), I have it
opening a subform that just has one text box, where the user will enter
in some more notes that will be added to the same record in the
database (subform closes when they are doen with it).
So here's what I thought would work (of course it doesn't):
1. On the main form's form_load section have a new record added
(rst.Addnew)
2. Have them fill in the text boxes (validate them of course)
3. If a "no" button is selected, open the subform, accept the text and
edit the newly added record with this text (rst.Edit)
4. When all is done, have them click on Submit on the main form and if
they accept it, it would them update the record (rst.Update).

WHOA.

You're doing all the work yourself that Access does FOR YOU.

If you just create a bound form, and open it, you will be on the first
record of that form's Recordsource (or a new record ready for data
entry if the recordsource is empty or the form's Data Entry property
is true). No code, no recordset, no buttons, no .Edits are needed.

Could you explain why you're doing all this the hard way?
The problem is when the subform "edits", it just edits the first record
in the table (it's like the rst.addnew code in the form_load is
ignored... because it does not add a new record).

Certainly. It's an unbound form. You're not putting data into a
record; you're putting data onto a form bound to nothing.
when it gets down to
the submit button code (main form), it blows up since I don't have the
rst.Addnew code there (remember, I thought I would put it in the
form_load section. I can't see how I can put it in the submit_button
section and still capture the comments and put them in the same new
record.

Could you explain why you're using the unbound form.. at all?
 
Back
Top