autonumber will not tranfer to new form

  • Thread starter Thread starter Barth Wilsey
  • Start date Start date
B

Barth Wilsey

I am trying to fill in data using a series of separate forms in the same
table
I have used the form wizard to link the forms so that the same record can be
edited by asking the new form to have a text box with the control that is
the same as the autonumber in the textbox of the previous form
However, when ever I open a new form, the autonumber is increased by one so
that I cannot edit the data of the record that I want to edit
If I check no to allowadditions, then my form is blank
thanks in advance, Barth
 
Try putting the following into the On Open event of any
form that needs to open to the last record rather than to
a new one:
DoCmd.GoToRecord , , acLast
To add the code, go to the property sheet (where you
experimented with the No Additions property), click the
Events tab, click On Open, click the three dots, click
code builder, and insert the code at the blinking cursor.
I think you might be making things a bit complicated by
using separate forms. My suggestion does not work if you
need to go back to edit a record other than the last one,
and it will only work if you open a particular form first
(without the above code). There are ways around those
limitations, but why? Have you considered a multiple page
form? See Help for "multiple page form" for more.
 
I am trying to fill in data using a series of separate forms in the same
table

This is a complicated way to do things! A couple of questions:

- Why? Does your table have so many fields they won't fit on one form?
If so, you should really consider "normalizing" your table structure;
a 60-field table is ENORMOUSLY wide.

- Have you tried using a single Form with a Tab Control, so that you
can share the same screen real estate?
I have used the form wizard to link the forms so that the same record can be
edited by asking the new form to have a text box with the control that is
the same as the autonumber in the textbox of the previous form
However, when ever I open a new form, the autonumber is increased by one so
that I cannot edit the data of the record that I want to edit
If I check no to allowadditions, then my form is blank
thanks in advance, Barth

Please post the code being used to open the form. Note that if you
have not yet saved the record to disk from the first form, using
either

DoCmd.RunCommand acCmdSaveRecord

or

If Me.Dirty = True Then Me.Dirty = False

then the record will not be available for the second form.
 
The reason that I want to use multiple forms is that I am trying to provide
a easy to comprehend user interface that my patients can use to provide me
details of their progress. I want to provide instructions for each question
and want the response to be the control source for an option box

I have seen commercialized versions of medical instruments such as this and
wanted to see if I could create one myself. I do not believe that someone
not familiar with tabs would be able to change the page that they are
looking and I probably need more pages than tabs can offer (same goes for
mutiple page forms)

thanks in advance for any help that you can provide; I have always been
amazed by the facility with which answers spring forth on these pages

Barth
 
Barth Wilsey said:
The reason that I want to use multiple forms is that I am trying to provide
a easy to comprehend user interface that my patients can use to provide me
details of their progress. I want to provide instructions for each question
and want the response to be the control source for an option box

I have seen commercialized versions of medical instruments such as this and
wanted to see if I could create one myself. I do not believe that someone
not familiar with tabs would be able to change the page that they are
looking and I probably need more pages than tabs can offer (same goes for
mutiple page forms)

thanks in advance for any help that you can provide; I have always been
amazed by the facility with which answers spring forth on these pages

You can use a TabControl with the Tab Style set to "None" and then use a [Next]
and [Back] button to change pages. I make wizard style interfaces like this
fairly often.
 
Back
Top