date does not show with "" around it 2nd time round

AccessMan

New member
Local time
Today, 16:09
Joined
Jul 18, 2009
Messages
8
If (Me.txt_EnterDate.Value) > lst_GetLastDate.Column(0) Then

at run time, when i have the next line on breakpoint, and put the mouse pointer over it (the above line), this shows;

Me.txt_EnterDate.Value = "30/12/2008"

but the next time round if i display calender and choose date 30/12/2008
the code does not go into

If (Me.txt_EnterDate.Value) > lst_GetLastDate.Column(0) Then

because, it shows this time (with mouse over it);

Me.txt_EnterDate.Value = 30/12/2008

Why might it be without the "" around the date?


Thanks for replies
 
I kind of got confused by your mechanical description of what you do. However, ...

When the mouseover function shows quotes around something, it is telling you that the something is in a text format. When it shows you the data without quotes, it is in some other format. If the something is always the same something regardless of what is in it, then it must be a thing of type Variant (which I believe is true for form controls that have a .Value property). A Variant is the only type of data holder that can be anything it needs to be.
 
If the text in a textbox is highlighted when i exit it, will it show as i mensioned above?
 
i have a txtbox and if i type a date into it and press search then the code will go into the following code showing message no payments


If Len(txt_EnterDate.Value) = 10 Then
If (Me.txt_EnterDate.Value) > lst_GetLastDate.Column(0) Then
MsgBox "There are no payments made after " & lst_GetLastDate.Column(0) & " !", vbExclamation, "CleanAll Services"
txt_EnterDate.SetFocus
txt_EnterDate.SelStart = 0
txt_EnterDate.SelLength = Len(txt_EnterDate)
skip = 1
End If
End If

but if i put the same date in the textbox with a calender (MSCAL.Calendar.7) then the code will not go through the second line i.e. no message displayed
 
Smells vaguely like different date formats involved. Text dates are, ... well.... TEXT. Whereas "natural" dates are in DOUBLE format. Totally different representation.

By the way, for a text box or recordset field, .VALUE is assumed if you don't specify some other property. Less code to be typed in that case.
 

Users who are viewing this thread

Back
Top Bottom