Autofill fields in a record...

VBAWTB

Registered User.
Local time
Yesterday, 23:22
Joined
Sep 26, 2011
Messages
30
Is there any way to automatically fill in certain fieilds in a new record on a form? For example, for adding multiple records, certain field data is the same for each record, until changed by the user...as they go the the next record, I would like those fields to be auto-filled with data from the previous record. ??? Thanks in advance!
 
If the data is a general default or eg today's date you can use the form control default value or even the table field default value.

If the dafault you want to use is wha was used for the last record saved and assuming the record primary key is a AutoNumber, then you could have your vba search (sql) the table and get the Max record data and use that as the form control source.
Set the vba to run on one of the form events or the form control even, say On Enter and the default data will be entered.
You need to place code on each of the form controls.

Better still set one vba to enter data on all the controls you require to be done this way on the Form On Open event but first test for any data in the controls and if no data, then run the vba to place the same data as the last record.
This way you avoid over writing every time you open the form with an existing record - if this is possible.
 

Users who are viewing this thread

Back
Top Bottom