Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input mask...??

Status
Not open for further replies.

Gurps

Technical User
Joined
Apr 2, 2003
Messages
1
Location
US
I have a field in a form which asks for the Expiry Date of a credit card. This date is in the form MM/YY (month/year). What input mask would I have to enter for this field so that if a date before the current date is entered, the system rejects it and says that the credit card has expired??

Any help would be appreciated.
thank you
 
there is a date function in Access that allows you to select records using today's date. if you are using a form you wod have to go into the VB code and type the following:

if me.expiry_date.text < Date() then
msgbox (&quot;his card has expired.&quot;, vbokonly)
end if

Try this it should work if you are looking for a way to place this in the table I don't think you can.
 
I'd recommend you store this information as text. Put an input mask of &quot;##/##&quot;. Add to the &quot;AfterUpdate()&quot; event for this control and put code there that will verify the data as valid.

Sorry, there's no &quot;easy&quot; built-in way. --
Find common answers using Google Groups:

 
An easy way is to use validation. Open the properties for the date field in question, go to validation rule, and type, &quot;date()&quot; without the apostrophies. under validation text type, &quot;credit card expiration date must not be expired&quot; or something to that effect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top