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!

Retaining data in a form

Status
Not open for further replies.

EthanVos

Technical User
Nov 14, 2002
8
0
0
CA
Good morning all.

Forgive my lack of proper terminology.

I have a data input form with 4 feilds. Upon hitting Enter in the last feild the form is cleared and the data written to a table.

Is there a way to NOT clear the form when the data is written to the table?

I don't know much (if anything) about using VB.

Thanks.

Ethan
 
Do yuo just want stay on the current record after you have entered all the data and hit enter in the last field???

If so, open the form in design mode, open the properties window for the form, find the property called Cycle, and change it from All Records to Current Record. Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCP, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Sorry I forgot to mention that I want to move on to the next record.

Ethan
 
Okay, so what you are saying is:

You enter data into a record and when you leave the last field the record moves to the next (blank) record and all your fields are cleared. You woudl instead like to have some "default" data appear in the fields when you move to a new record.

I highlighted the answer above....simply return to your table design and set a default value for each field that you want data to be automatically filled in for you upon a new record.....you cans till change this data, it is just what access gives you to start with..... Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCP, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
I'm not explaining this well.

I don't need to set a permanent default. I'd just like the data to be the same as the previous (just entered) record.

For instance, I may have to enter data three or four times for the same date or the same part number and would rather not have to re-key the same data three or four times. It'd be easier and faster to just hit Enter.

I don't want to keep changing the default because I will have to pass this along to someone else at some point and it should be idiot-proof.

Ethan
 
Well, while this can be done, you are probably asking for trouble......I would venture to say that setting something like this up as "idiot-proof" would be far from idiot proof.

Reasoning:

About the only way to work something out like this is to use the OnCurrent Event of the form. If you simply create some variables and repopulate the new record with this, you are bound to copy data from one record to the next inadvertently, because every time you move from record to record it will copy the data....you could probably work in some code that checks the form's current record set, and if you are at the .eof marker, then copy the data in.....but I still wouldn't recommend it. You could also probably fill the vairable, and check if the field is null when moving through recrods....but again, you stand to have problems....

My immediate suggestion is to create comboboxes for you selection instead of text boxes....reasoning for this is that a combobx can beset to autofill, so the user will only have to enter the first couple of letters and it will fill in the rest...if you set the combobox limittolist propery to no, they can use items not found in the list, but will have to type them out completely.... Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCP, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Thanks for the replys. It sounds like it's best to keep things the way they are.

Ethan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top