Dates in short format formatted within a string

ponneri

Registered User.
Local time
Today, 17:39
Joined
Jul 8, 2008
Messages
102
Hi.

I have a form in which I fill some fields (3 text boxes, 2 combo boxes). The last field is also a text field (255 chars) that needs to be populated based on the other fields.

It's like a string concatenated.
The fields are date_in, date_out, item_name, status. My code is as follows :

me.status = "Recd " + item_name+ " on "+ str(date_in)+" and sent out on "+str(date_out)

The string appears but the dates which are actually in short date format (ex: 15-Oct-17, 22-Oct-17) get changed to "Recd Tapes on 10/15/17 and sent out on 10/22/17".

I need the dates to be in " short format as they were entered in the string".

Can someone help please ? :(
 
Try using the "&" as a concatenation character instead of the "+".
 
In addition, you may also need to do the Formatting in your concatenated string itself:

Code:
me.status = "Recd " & Me.item_name & " on " & Format(Me.date_in, "dd-mmm-yy") & " and sent out on " & Format(Me.date_out,"dd-mmm-yy")
Linq ;0)>
 
Thanks for all the help. Will try and see.

Concern is the date part in the string.
 
One more thing.

Is there no need to convent the date into a string like str(format(.... ??
 
The output of the Format() function is always a String.
 

Users who are viewing this thread

Back
Top Bottom