-
I have the following variable that is replacing the "/" with "_" and is taking the first 9 characters to the left. I then place that variable in a text box. txtdate.text is grabbing the date created attribute from a file and putting it into its text property. This works great, the problem occours when the date is say 1/2/2000. On some computers this shows as 1/2/00 leaving three spaces after that. At this point it then grabs the three next characters which are a space, and the first two digits of the time it was created. Example 1/2/00 12. What I want to do is have the date only be thrown into the fdate variable. In other words 11/09/2000. Do anyone see a way to do this? I have tried to format it as a date but it then formats is as the current date????
Dim fdate As String
'this names the file according tot he date, client ID and type of doc
fdate = Left(Replace(txtDate.Text, "/", "_"), 9)
-
<?>
MsgBox Format("1/2/00", "ddmmyyyy")
'or
MsgBox Format("1/2/00", "dd/mm/yyyy")
-
<?>
or in the event of variables
Code:
Private Sub Command1_Click()
x = "1/2/00"
y = "11/22/2000"
x = Format(x, "dd/mm/yyyy")
'or
y = Format(y, "dd/mm/yyyy")
MsgBox x & vbCrLf & y
End Sub
-
When you put in the 1/2/00 or 2000 doesn't that specify that specific date or does it refer to all dates?