date with no slashes

REDaughdril

Registered User.
Local time
Today, 13:38
Joined
Jan 23, 2000
Messages
58
I have a text box that takes the date of service and adds a "!" before and after the date. (control source ="!" & [dtmDateOfService] & "!")

That works but I need to take the slashes out so my bar code reader will read it as a date.

What do I do to get rid of these slashes?

Thanks
 
You can use a combination of the MID and the LEN function to strip out the "slashes".

Here's an example using a query:

SELECT YourTextBox
BoxMID(YourTextBox,2,Len(YourTextBox)-2),
FROM YourTable;

You also will have to convert your text to a date.
For this, you'll also need the CDate function:

SELECT YourTextBox
CDate(MID(YourTextBox,2,Len(YourTextBox)-2))
FROM YourTable;

But... you already have a Date of Service available... why not simply using that date instead of first adding text and stripping it later on?


RV
 
How about reformatting the date field (if it is really a date)?

Control Source ="!" & Format([dtmDateOfService],"mmddyyyy" & "!")

HTH
 

Users who are viewing this thread

Back
Top Bottom