I have a form that has four fields for which I want to set default values. Due to the nature of the data entry process, the values will be the same in these fields for dozens and sometimes hundreds of sequential records, and then it will need to change for the next dozens or hundreds, and so on.
What I've done is to set the fields to a "no tab" option, and what I would like to have happen is *only* when the value needs to be changed, the operator will click in that field, type in a value, and upon exit, that (current/last record) will automatically become the new default value until it is changed again.
I have tried to use the dlookup and/or dlast functions, but I'm somewhat confused about the syntax and have not had success. I've also resorted to putting some unbound text fields on the form footer to serve as default values, but that seems rather klugy, plus the behavior is erratic, as sometimes (but mysteriously, not always) what will happen is the default value will appear when the new record is first created, but after I tab completely out of the first active tab field, the "default value" fields (all 4 of them) are suddenly empty.
So anyway, I would be very grateful if someone could provide an example of how I can accomplish my goal, and even more grateful if you could use the names in my form/table in the example, which are as follows:
Form name: frmVoucherRegDataEntry
Based on: qryDataEntryForm
Table: tblVoucherRegister
(there is also another talbe in the query - tblVendorName - but it is not needed for this function)
Field name: vrVRBatch
Control Name: txtvrBatch
Current "dummy value" control name: BatchDateDefault
THANKS!!!!
Karen Schouest
What I've done is to set the fields to a "no tab" option, and what I would like to have happen is *only* when the value needs to be changed, the operator will click in that field, type in a value, and upon exit, that (current/last record) will automatically become the new default value until it is changed again.
I have tried to use the dlookup and/or dlast functions, but I'm somewhat confused about the syntax and have not had success. I've also resorted to putting some unbound text fields on the form footer to serve as default values, but that seems rather klugy, plus the behavior is erratic, as sometimes (but mysteriously, not always) what will happen is the default value will appear when the new record is first created, but after I tab completely out of the first active tab field, the "default value" fields (all 4 of them) are suddenly empty.
So anyway, I would be very grateful if someone could provide an example of how I can accomplish my goal, and even more grateful if you could use the names in my form/table in the example, which are as follows:
Form name: frmVoucherRegDataEntry
Based on: qryDataEntryForm
Table: tblVoucherRegister
(there is also another talbe in the query - tblVendorName - but it is not needed for this function)
Field name: vrVRBatch
Control Name: txtvrBatch
Current "dummy value" control name: BatchDateDefault
THANKS!!!!
Karen Schouest