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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do this ??

Status
Not open for further replies.

Tailgun

Technical User
Mar 30, 2002
417
0
0
US
I have a form that uses .addnew. After the user enters the data and saves it, it becomes record one in that table. Now the user wants to add another new record so the same form is used to add another .addnew however I would like to fill several of the textboxes in the new .addnew form with the information from the first saved record so that the next record contains that information in several of the textboxes. I hope this makes sense to someone in here.

Anyone have a clue as to how I can do that?

Thanks

 
If you want to access information in the previous record, you can use the moveprevious property of the ADO's Recordset.

The downfall to this is that you are accessing the database way too much imo.

What I would do is maintain a series of variables (the number of fields you want to maintain over to the next record) and assign the values of the fields to the variables for the carryover to the next record added. Doing this, when your program is closed and cleaned up (variables cleaned up from memory), you will have a "log" of sorts keeping track of which items were entered into the database at the same time which is what it sounds like you are trying to do (i.e. username tracked to see who put what where).
 
Your form has a number of text boxes.
Don't data bind them.


Create a recordset in code.
When the user hits save,
open the recordset
get the data from each of the textboxes,
do your recordset.addnew,
set the fields of the new record to their values,
and update
clsoe the recordset.

Don't empty the text boxes unless you specifically don't want data retained.
(eg for an employee database you may elect to keep the textbox for 'place of work', but to wipe the textbox for 'surname')




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top