Capturing date on a form

BobNTN

Registered User.
Local time
Today, 14:07
Joined
Jan 23, 2008
Messages
314
Don't know if this should be in Forms or what.
I have a command button on a form I execute a query with. The query saves the current date to a field in the table. I am trying to capture that date to place next to the button so the user knows when it was ran last. no luck so far.
Tried the date field as a text box but, of course, it doesn't know which record to use. Is there a simpler way ?
 
Not sure I'm following your post correctly..... You have a date field in the table..... It records the current date...How?
If you add something like Me.DateField = Now() to the on Click event of the command button and have a textbox for the date on your form... that should insert the date into your field and record.
I use these often to record when a report was emailed.....
 
When I run the query, I save the current date to each customer's record in the 'Lastdebit' field.
I want that date to display next to the button that runs the query as a reminder of when the debit query was last run so she doesn't debit needlessly.
 
If I understand correctly you are looking at a customers record, and on that record is a button that runs a query. You want to show the date that query was last run beside the button.
If that date is saved in the customers record in the tables then you should just be able to show that field as a text box next to the button. If your problem is updating the bow when the query has ben run you will need to save the record ans refresh the form as part of the query code.

If on the other hand I have not understood correctly, sorry!

Sue
 
I have a query that debits (applies the monthly charge) to the balance of all customers. The query takes today's date (the day it is executed) and updates the customer's 'Lastdebited' field.
This can not be run more than once a month because it would double charge each customer. It would normally be run a day or so before invoicing.
I am using a command button to execute that query. The button is on a form called utilities. I just wanted the date the query was run last to show up next to the button so that she can make sure she isn't double debiting.
 
HI Bob,

I think I am getting a better picture now.

Do you run this query and it updates for all customers, or do you run it once for each customer.

If it updates all customers at the same time, maybe you could save the last run date in a table of it's own and put this table in the record source of the utilities form and show that field next to the button.
If that isn't ging to work with whatever other datasource you already have on the form you could put an unbound text box on the form and assign the value in code. In the open event of the form (or maybe the on current event you might have to experiment) you could use dlookup to read the last run date from your table and assign it to the unbound text box.
I think this should solve your problem.
In the on click event of the button you could even run a check to see if the query has ben run this month yet, and show a message box if it has to ask if they really want to run it again. Just a thought, good luck.

Sue
 
Thanks Sue and everyone

Got it working on the Lastdebit field.

One more question along this line if I may. Then if I figure the switchboard text problem out, I'm puttin' this baby to bed.
You guys can't imagine how much you have helped me get this thing going.

I have a field (presently in TblCustInfo) called Rptmemo which is just a text field to place on Invoices as a message to customers. Same message to all. If nothing in it, it is transparent on the invoice. Seems like a waste to have this in a table 3000 times. What's the best practice for setting it up as a one place field and to be able to edit or erase the data in it ? I tried a separate table for it then associated on a Utilities form but can't figure how to edit it. Just has error in it in design view ?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom