Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create a form that opens on a new record but allows edits?

Access Howto:

How do I create a form that opens on a new record but allows edits?

by  Quehay  Posted    (Edited  )
To have a data entry form that lets users start entering records but also easily go to existing records for editing do the following:

(This works only for forms that have a combo or listbox to look up and go to existing records. The wizard will do it, just select "find a record in my form. . .".)

Set the [tt]DataEntry[/tt] property for the form to true/yes in the data section.

In the [tt]AfterUpdate[/tt] event of the combo or listbox there will be wizard generated code to the effect of:

[tt] Dim rs as object

Set rs = me.recordset.clone
[/tt]
Before the Set statement put in the following line of code (you'll get an error if it comes after the Set statement):

[tt] Me.DataEntry = False [/tt]

The form will go to an existing record when a selection is made in the list or combo and the navigation controls will be enabled (and show "Record _ of ___" for the total in the table).
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top