Access 2010 Copy data from one field to another in form

jbc

New member
Local time
Today, 14:18
Joined
Jul 1, 2013
Messages
2
Hello,

I am using Access 2010. I have a database that tracks rental income for apartment buildings.

Most of the time a tenant pays his exact rent. When that happens, I currently type in the payment (taken form the Rent field) and date of payment (current date) into a form. The date should not change.

I would like to place a checkbox into the form. If checked, the rent would be entered into the payment field and payment date (current date) would be entered automatically. Otherwise, I would just enter in the payment and date manually.

FIELDS
Rent

Payment
PaymentDate

on form chkPayment

Thanks.

Jbc
 
Place a command button on the form and in the On Click event add the code:
Code:
Me.Payment = Me.Rent
Me.PaymentDate = date()
 
Why not simply set the Default Value of the date field to Date()? If the current date is appropriate, the date is there; if not, you can enter the appropriate data. That way, you wouldn't have to do anything (click a Checkbox, click a Button) if the rent was paid in full, which I assume is the usual event. You'd only need to enter the date if the rent isn't paid in full, which you're already doing.

Linq ;0)>
 
Thank you for your help!

The code is working perfectly.

jbc
 

Users who are viewing this thread

Back
Top Bottom