Hey everyone,
I apologize if my question doesn't make any sense. I'm new to access so please forgive me.
I have a table called TblTransactions. The fields are as follows:
Transaction_ID (PK, auto number)
TransactionDate (Date/Time)
TransactionTime (Date/Time)
CustomerName (Text)
CompanyName (Number - CboBox)
OPSInitials (Text)
BankTotal (Number)
This table was used to create a query, and a form.
On the form, I would like the value in BankTotal from the previous record auto populate in an unbound text box called TxtCurrentBank. Here's what I've tried so far without success:
I set the Control Source of txtCurrentBank to : DLookup("[BankTotal]","[TblTransactions]","[Transaction_ID] =" & [Transaction_ID]-1)
If I delete a record, then Transaction_ID-1 doesn't exist, and the text box is blank. Also, once i close and re-open the form, the Tex Box doesn't auto populate.
I have read other threads where people have had the same problem, but couldn't figure out how to make the code work for my form.
I have tried to combine dlookup and dmax together in an expression but couldn't get that to work either.
Please help! Thank you in advance!
-Zoober
I apologize if my question doesn't make any sense. I'm new to access so please forgive me.
I have a table called TblTransactions. The fields are as follows:
Transaction_ID (PK, auto number)
TransactionDate (Date/Time)
TransactionTime (Date/Time)
CustomerName (Text)
CompanyName (Number - CboBox)
OPSInitials (Text)
BankTotal (Number)
This table was used to create a query, and a form.
On the form, I would like the value in BankTotal from the previous record auto populate in an unbound text box called TxtCurrentBank. Here's what I've tried so far without success:
I set the Control Source of txtCurrentBank to : DLookup("[BankTotal]","[TblTransactions]","[Transaction_ID] =" & [Transaction_ID]-1)
If I delete a record, then Transaction_ID-1 doesn't exist, and the text box is blank. Also, once i close and re-open the form, the Tex Box doesn't auto populate.
I have read other threads where people have had the same problem, but couldn't figure out how to make the code work for my form.
I have tried to combine dlookup and dmax together in an expression but couldn't get that to work either.
Please help! Thank you in advance!
-Zoober