Text box question

  • Thread starter Thread starter bomantas
  • Start date Start date
B

bomantas

I have a text box in my form and another with the date. I want to make
it so that if the "date" text box is >= to jan1, and <=jan31 then the
other text box will display 1. for febuary is 2, and so on. how can I
do this in one string so that ultimately I have all months strung
together so that if any date is entered then the other box will have
the corresponding number inside automatically. All I have so far is > =[Date]>=#1/1/2004# And #1/31/2004# = 1 and of course this does not work. Can anyone help me?
Thanks,
Marc
 
Assum: TB1 is the text box a date wil be entered
TB2 is the text box to display the month number
In the default for TB2 put =Month(TB1)

But on the ON UPDATE event of TB1 you will have to refresh the TB2
control or it will not change.

OR on the ON Update event of TB1, you can put Me.TB2 = Month(Me.TB1)
 
Thanks it worked! One more thing (I really am about to show my
stupidity here) Why I wanted to do this was because I wanted to filter
by form. But why is it that when I filter by form that every other
text boxes have drop down arrow options but the one that you just
helped me with? But again, Thank you about the first problem.
Marc
 
Text boxes or combo boxes?
Text boxes do not have drop down arrows.
If it is a combobox, why? You are setting the value.
 
Now I am going to show my real stupidity as I try to explain what I mean
(sorry if I get the lingo wrong) In the forms, I want to sort by the
button filter by form and when I click it it clears the boxes and next
to the text boxes it has that arrow down thingy, and I want it to be
able to sort by different criteria. First would be sales person, then
island(from Hawaii), finally date. The first two were easy to filter
but the last one the date was inserted fully (01/23/04) but I only
needed the month, (thanks again for that) but when I choose this filter
by form all of the text boxes have that drop down option except for the
month. Sorry to keep rambling but I was hoping that if I was doing
anything wrong or you could think of a better way you could help me.
Sorry for taking up all of your time again,
Marc


+----------------------------------------------------------------+
| Attachment filename: filter.jpg |
|Download attachment: http://www.MSAccessForum.com.com/forums/attachment.php?postid=143168|
+----------------------------------------------------------------+
 
Filter by form gives you selection (Down arrow thingy) when you have a
field bound to the underlaying data source (table or query). That box
must not be bound to the underlaying data source, hence no selection,
and no column to base it on (hence it is grey, can't use it). Filter by
Form has these kinds of limitions.
 
Thanks again for all of your help. I really could understand what you
put. Thanks again. I think I will buy a book to get the basics
first.:)
 
Back
Top