PC Review


Reply
Thread Tools Rate Thread

Alow certain Date Range

 
 
mikester104
Guest
Posts: n/a
 
      21st Oct 2006
Here is a hard one i have been stuckon for a while. I have a user form that
does a now statemnet to automatically fill a text box. However a user can
input a another date in the date issued textbox. What i want it to do is if
that date that the user enters in is to old then it iwll pop a msgbox up.

For example this being October can you have the date limit allow input for
August, September and October and flag any with dates before August as too
old to accept? Now this will have to be an xpression that will update from
the now statement. So if its now month is November then it will allow info
for November, October and September but flag any past dates. I know this is a
wierd one but i thought i was getting good at programming till this happend.
Thanks for anyone hlp on this.

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      21st Oct 2006
If CDate(txtDateIssued.Text) >= DateSerial(Year(Date),Month(Date)-2,1)
And
CDate(txtDateIssued.Text) <= DateSerial(Year(Date),Month(Date)+1,0)
Then
Msgbox "Valid"
Else
Msgbox "Invalid"
End If

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"mikester104" <u28159@uwe> wrote in message news:681bc82a08e30@uwe...
> Here is a hard one i have been stuckon for a while. I have a user form

that
> does a now statemnet to automatically fill a text box. However a user can
> input a another date in the date issued textbox. What i want it to do is

if
> that date that the user enters in is to old then it iwll pop a msgbox up.
>
> For example this being October can you have the date limit allow input for
> August, September and October and flag any with dates before August as too
> old to accept? Now this will have to be an xpression that will update from
> the now statement. So if its now month is November then it will allow info
> for November, October and September but flag any past dates. I know this

is a
> wierd one but i thought i was getting good at programming till this

happend.
> Thanks for anyone hlp on this.
>



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      21st Oct 2006
See your other post.

mikester104 wrote:
>
> Here is a hard one i have been stuckon for a while. I have a user form that
> does a now statemnet to automatically fill a text box. However a user can
> input a another date in the date issued textbox. What i want it to do is if
> that date that the user enters in is to old then it iwll pop a msgbox up.
>
> For example this being October can you have the date limit allow input for
> August, September and October and flag any with dates before August as too
> old to accept? Now this will have to be an xpression that will update from
> the now statement. So if its now month is November then it will allow info
> for November, October and September but flag any past dates. I know this is a
> wierd one but i thought i was getting good at programming till this happend.
> Thanks for anyone hlp on this.


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Divide a a range of dates into intervals starting with the current date or the latest date in the range of dates Daryl Microsoft Access Queries 2 8th Jan 2010 05:27 PM
Date range and creating a formula to use in a second date range Bobbye R Microsoft Access Queries 0 31st May 2009 11:52 PM
How do Count a the number of times a date range appears within a date range!? leelondon Microsoft Excel Discussion 5 4th Oct 2006 12:12 PM
Link date to a table with Date Range (Eff Date and term date) =?Utf-8?B?S2V2aW4gUmVlZA==?= Microsoft Access 1 31st Aug 2006 04:23 PM
Query Date Range Criteria Doesn't Include Last Date in Range Karl Burrows Microsoft Access Queries 6 10th Jun 2005 07:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:10 AM.