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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Added auto date entry when checkbox checked 2

Status
Not open for further replies.

abbottboi

IS-IT--Management
Nov 14, 2005
94
CA
Hi,

I have one column for Receipt with a checkbox (yes/no) and the other with a Receipt_print_date text entry field.

Is there a way to autofill the receipt_print_date with todays date once i click the check box for receipt?

please let me know.. thanks!
 
In the on_click event of the check box put

<textboxname>=now() for the date and time or
<textboxname>=date() for just the system date
 
awesome!!! I did that put once i click on it it says 'Macro doesn't exist'?!?

where would i enter in this macro so that it finds it?
 
Put the code jadams0173 suggested on the form, under the check box after update event.
 
Hi Shirley,

Could you re-word that so it could make sense to me?

I have the code as such <tax_receipt_print_date>=date() in the 'on click' portion of the 'events' tab. It says the macro doesn't exist

what else do i do?

thanks a million
 
Put the code in the event procedure, ie click the ellipsis (...)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Right Click on the check box, then in the property window you will see After Update. Over the the right of the event there are "...", Select the "..." and then select code builder. Then put the code jadams0173 suggested under the VB event.

me.textbox = Now() or Date()
 
actually just one more thing.. is there a simple IF statement i could insert to say: "If there is already an entry into the date field 'tax_receipt_print_date'... do nothing"

I have some records with date already in them so i don't want to be able to write over the date but i would like to check the box to say there is a receipt already printed.

thanks
 
Yes if there are dates already there, that would be a good ideal. But use if me.textbox is null then put the date.
 
what would be the exact code for that?

the code now is:
Code:
Private Sub tax_receipt_printed_AfterUpdate()
tax_receipt_print_date = Date
End Sub
 
Try This:
"If tax_receipt_print_date = null then
tax_receipt_print_date = Date
End if
 
Shirley, I think you meant this:
If IsNull(tax_receipt_print_date) Then

Nothing may equal Null !

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top