Need Input Mask for a textbox

F

FA

Hi Freinds,
I have a field FINDG_NO in my sql server that has datatype Varchar. Its
a Primary Key of the table.
On my Access form called frmFinding i have a text box called
txtFindingNo in which user will input the Finding No.

The finding Numbers are in the following format
Five charachters in the begining then today's date and three
alphanumerics at the end.
Sample Finding No: ABCDE01/06/06K75

Is there anyway i can define the input mask for the text box
txtFindingNO so that it shows five fillers "_" in the begining then
automatically today's date and three filler "_" in the end.
something like this : _ _ _ _ _ 01/06/06_ _ _

If there is a VBA code for this functionality please let me know or if
i can do something in the input mask please folks do let me know.

Thanks bunch

Moe
 
G

Guest

Hi, FA.

There are of course many ways to skin this cat, but my preference would be
to ignore the date part entirely, prompting the user for the first five and
last three characters, then calculating the needed Finding Number:

Input Mask for 8-character textbox: >LLLLLAAA
Calculation to contatenate to complete Finding Number:

=Left([YourTextbox],5) & Format(Date(),"mm/dd/yy") & Right([YourTextbox],3)

If doing the same thing for a different date, I'd use the same approach,
with a calendar control to select the date. See Stephen Lebans website for
the latter (www.lebans.com).

Hope that helps.
Sprinks
 
F

FA

Hmmmmm, it makes sense but the thing about it is how and where do i put
the calculations. See i am very new to MS Access so if you specify that
to me, i would be much obliged.

Thanks Millions

Moe
 
G

Guest

FA,

You can either set the Control Source of another control to the calculation,
or use assign it to a variable in the event procedure that does the finding.

Sprinks
 

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