Problems with Date Format (American- European)

AlvaroCity

Registered User.
Local time
Today, 07:06
Joined
Jul 16, 2016
Messages
70
Guys I need your help. I bumped into a problem....

The thing is that in this form when I introduce the date ("Fecha" in Spanish) in the txtbox to filter the form, this does not do it properly.
I realized that the problem is that the Format of the date is in American (eg. "12/31/2016") instead of European

Any idea how to format the date?

Untitled.png
Untitled1.png


Thank you everyone. You are the best!!!
 
I dont know yet why this happens... It is really weird.

When I debug the code, everything seems to be okay...

Any idea?

I also checked the language and region configuration from the settings of my windows and they are okay I think
 
Sorry for the delay as I was on holidays and I was not able to deal with this.

the code is the next:

Code:
Private Sub cmdBuscar_Click()

    Call Buscar
    
End Sub


Sub Buscar()

    Dim SCriteria, task As String
    
    Me.Refresh
    
    If IsNull(Me.txtDesde) Or IsNull(Me.txtHasta) Then
        MsgBox "Porfavor introduce fecha", vbInformation, "Introducir Fecha"
        Me.txtDesde.SetFocus
    Else
        SCriteria = "([Fecha]>= #" & Me.txtDesde & "# And [Fecha] <= #" & Me.txtHasta & "#)"
        task = "SELECT * FROM frmVerAlbaran WHERE (" & SCriteria & ") ORDER BY [Fecha]"
        DoCmd.ApplyFilter task
    
    End If

End Sub


Private Sub cmdLimpiar_Click()

    Dim task As String
    
    Me.txtDesde = Null
    Me.txtHasta = ""
    task = "SELECT * FROM frmVerAlbaran WHERE id isnull"
    DoCmd.ApplyFilter task
End Sub

I hope this will be helpful.

Thank you everyone
 
I dont this to dates:

Code:
Function GetDateConvert(SearchDate As Variant) As String
    GetDateConvert = Format(SearchDate, "mm/dd/yyyy")
End Function

I just create another Function if I need to convert multiple dates.

Simon
 
Did you read the link? Did you try formatting in US format?
 

Users who are viewing this thread

Back
Top Bottom