+ 1

Query code in vba (access form) for integer value

Hi all In access i have a table that include one integer type field. I create a form for search that field but because textbox is string value i got error How fix it? task = "select * from Cutting where [DateCutting]= #" & Me.txtfrom.Value & "# " DateCutting is long integer type

23rd Jun 2020, 1:25 PM
Hadi
Hadi - avatar
3 Antworten
+ 2
find it should use it without ' and # (for number) strCriteria = "[Number] = " & Me.txtNumber & ""
23rd Jun 2020, 1:52 PM
Hadi
Hadi - avatar
+ 2
Yes, as I remember, single quotes are used for string like types. And # are used for date types.
23rd Jun 2020, 3:17 PM
Ipang
+ 1
I hardly still remember, but isn't a date value that is surrounded by # symbol? numbers doesn't need # wrapping as I recall.
23rd Jun 2020, 1:35 PM
Ipang