Help with control

M

micfly

- Access97



I have a control on a form to select the month of sale. It uses a combo box
to select the month/year from the tblMonthOfSale table as in 11/2008,
12/2009 and so forth. In tblMonthOfSale the MonthOfSale field has a data
type of text with a validation rule of: Like "##/####"

The control source for this combo box is MonthOfSale located in the forms
main table tblTracking with text data type. The combo box' default value is
set to =Format(Now(),"mm/yyyy") .

The reason for this is I want the current month value entered by default
which is most of the time. There are occasions after the current month we
are still entering deals for the previous month and will need to click and
change it. <Hope all this is making sense> The problem is when frmTracking
is opened you can enter all the info needed and it will save the month of
sale if you don't touch it, but, if I try to change the month of sale by
clicking the combo box I get the error "The value you entered isn't valid
for this field". I can click OK twice and it will take the selection and let
me finish entering the rest of the data. If I am navigating through existing
records I can change the month of sale no problem. Any suggestions on a
better design for this or a way around the error? Thanks for putting up with
the newbie :)
 
D

Dorian

I would just have a 'date of sale' column, from which you can extract the
day, month or year as needed. Having a column for just the month/year is
weird.
Validation rules are not a good idea either. '/' is probably being
interpreted as a division operator. Why make things difficult for yourself.
Keep it simple. It's best to have all dates chosen from a calendar; that way
no validation is needed.

-Dorian
 
M

micfly

Thanks for the suggestion. I think you're right, I already have a date of
sale textbox. I still will need to pull deal info by month and year, though.
How would I put that in a query? Say, deals sold for the month of 11/2008.
Thanks for any help!
 

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