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!

DLast() Function

Status
Not open for further replies.

linda55

Technical User
Jun 22, 2001
19
0
0
US
On my form I have a text box named CheckCode. On its After Update Event I have code which automatically fills two other text boxes. This has been working great for several years. Then I got the idea that I wanted the first text box to repeat data from the previous record so I put in the default value DLAST("CheckCode", "Checks"). Now the auto fill event does not happen. Could the auto fill code be put in another event to make it happen? Thanks in advance for your help.I have really learned a lot from the questions and answers in this forum although a lot of the code is over my head.
 
What are you attempting to do in using the DLast function?
Taken from Microsoft help file:

Use the DLast function to return a random record from a particular field in a table or query, when you need any value from that field. Use the DLast function in a macro, module, query expression, or calculated control on a form or report. Variant


You would be better storing this value in some kind of variable (probably a class-module global variable)... James Goodman
 
I am entering a series of checks and their amounts. The form automatically fills in the accounts that are to be debited and credited. I want to enter the bank code and check code for the first record then the subsequent records would repeat the same bank code and check code for that series of checks. I put DLAST("BankCode", "Checks") as the default value of the BankCode text box and that worked fine. But when I did the same for the checkcode text box the auto fill code ceased to work. I just thought maybe the auto fill code might be put somewhere else and it would still fill in the data for the debit and credit text boxes. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top