Suppress "Based on an expression" error message

E

Evi

My database records expenditure.
Because there are many expenditures I want to group them by Month.
My main form is based on a Months table contains a Months field and MonthID
which numbers January as 1, February as 2 etc
My subform query contains a calculated field called Mnth which has
=Month(TransactionDate) in the Query
I want to link the main and subform by MonthID/Mnth which works
Of course, I know that the main form can't add a date to the subform but
that isn't a problem. The current date is the Default value of MyDate in the
table but it can always be changed if required.
It doesn't matter that I can view the month of April and then add a
transaction for December. The form sorts itself when I turn over a page.
The only problem is that when I add a transaction I get the error message
'field Mnth is a calculated expression and cannot be edited'. After I press
OK I can continue to enter the record and everything is fine.
So how can I suppress this particular error message?
Evi
 
J

John Vinson

So how can I suppress this particular error message?

By not trying to edit the Mnth field. If you have a combo box to
select a value from the calculated field, make it unbound (set its
Control Source to blank) rather than binding it to the field.

It seems to me that you're making your life a WHOLE LOT harder than it
needs to be; I don't see any need for this table at all! Can't you
just store (and sort by) a date, and use a format property in a
textbox to show the month?

John W. Vinson[MVP]
 
E

Evi

John Vinson said:
By not trying to edit the Mnth field. If you have a combo box to
select a value from the calculated field, make it unbound (set its
Control Source to blank) rather than binding it to the field.

It seems to me that you're making your life a WHOLE LOT harder than it
needs to be; I don't see any need for this table at all! Can't you
just store (and sort by) a date, and use a format property in a
textbox to show the month?

John W. Vinson[MVP]

You're right John. I'll have to do that. I just liked having 1 page per
month on the form.
Evi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top