A
Ami
I posted this message a while back, I thought i understood what to do but
have run into problems with it, Is it safe to assume that this should be
typed in a module. I dont know how to go about implementing this. Please
Help!
My question was...
I have a main form and a subform. The main form holds client information;
name, account #, etc. The subform is to record new payments on accounts.
I would like to automatically assess a five dollar fee on the first of every
month. I am not quite sure how to go about this. Any suggestions?
This was the reply i got from a very knowledgeble person:
written the programming side before.
have run into problems with it, Is it safe to assume that this should be
typed in a module. I dont know how to go about implementing this. Please
Help!
My question was...
I have a main form and a subform. The main form holds client information;
name, account #, etc. The subform is to record new payments on accounts.
I would like to automatically assess a five dollar fee on the first of every
month. I am not quite sure how to go about this. Any suggestions?
This was the reply i got from a very knowledgeble person:
I just dont know where to start in putting this into play... Ive neverFirst you must see if the fee has already been assessed for this month. To
do that, you count the records after the first of the month. So:
Function FirstOfThisMonth() As Variant
' PURPOSE : Returns the first day of the current month.
FirstOfThisMonth = DateSerial(Year(Date), Month(Date), 1)
End Function
Then you can run a query:
SELECT MyTable.DateField
FROM MyTable
WHERE (((MyTable.DateField)>FirstOfThisMonth()));
And if it returns a record, exit the sub, or if not add a record:
INSERT INTO MyTable ( [DateField], [CurrencyField] )
SELECT FirstOfThisMonth() AS Expr1, 5 AS Expr2;
written the programming side before.