I am trying to open up a form using the following linkcriteria
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmNewDrawings"
stLinkCriteria = "[datefiled] " & "Between " & Me.txtstart & " And " & Me.txtend
DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria
but I cannot get it to return records. I presume it is something to do with the date format. I have tried just copying the syntax from a query but that doesn't work either. Any help anyone?
I am using Access 2003 .adp
I have also tried
stLinkCriteria = "[datefiled] " & "Between #" & Me.txtstart & "# And #" & Me.txtend & "#"
also
DoCmd.OpenForm "frmNewDrawings", _
WhereCondition:= BuildCriteria( "datDateField" _
, dbDate _
, "Between " & txtStart & " And " & txtEnd )
also
Dim strCriteria as String
strCriteria = ">= '" & Forms!<FormName>.txtStart & "' AND <= '" & Forms!<FormName>.txtEnd & "'"
Me.ServerFilter = strCriteria
This opens the form but the records aren't filtered this is the value in strCriteria when debugged
"[datefiled] >= '22/09/2004' AND <= '24/11/2004'"
and [datefiled] = 30/11/2004
also strCriteria = "[datefiled] >= '" & Format(Forms<FormName>.txtStart,'Short Date') & "' AND [datefiled] <= '" & Format(Forms!<FormName>.txtEnd,'Short Date) & "'"
strSQL = Select <FieldList> from <Table> Where " & strCriteria
Me.RecordSource = strSQL
This one says format is not a recognised function name.
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmNewDrawings"
stLinkCriteria = "[datefiled] " & "Between " & Me.txtstart & " And " & Me.txtend
DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria
but I cannot get it to return records. I presume it is something to do with the date format. I have tried just copying the syntax from a query but that doesn't work either. Any help anyone?
I am using Access 2003 .adp
I have also tried
stLinkCriteria = "[datefiled] " & "Between #" & Me.txtstart & "# And #" & Me.txtend & "#"
also
DoCmd.OpenForm "frmNewDrawings", _
WhereCondition:= BuildCriteria( "datDateField" _
, dbDate _
, "Between " & txtStart & " And " & txtEnd )
also
Dim strCriteria as String
strCriteria = ">= '" & Forms!<FormName>.txtStart & "' AND <= '" & Forms!<FormName>.txtEnd & "'"
Me.ServerFilter = strCriteria
This opens the form but the records aren't filtered this is the value in strCriteria when debugged
"[datefiled] >= '22/09/2004' AND <= '24/11/2004'"
and [datefiled] = 30/11/2004
also strCriteria = "[datefiled] >= '" & Format(Forms<FormName>.txtStart,'Short Date') & "' AND [datefiled] <= '" & Format(Forms!<FormName>.txtEnd,'Short Date) & "'"
strSQL = Select <FieldList> from <Table> Where " & strCriteria
Me.RecordSource = strSQL
This one says format is not a recognised function name.