So I have a text box, and when the user enters a value into this text box I am filtering a form. The user enters a "7" inside the text box and a form opens with all records updated in the past 7 days. In order to do this I am using
docmd.openform "myform", , , stringfilter
stringfilter is a string I created where I am trying to use the datediff function. The name of my field that has the last edited date is called [timestamp]. So I thought this would work but for some reason it does not:
stringfilter = "datediff( " & "d," & "#timestamp#," & "now" & ") < " & mytextbox.value
I expect the output of this string to be the following, but i don't believe it is:
datediff("d",timestamp,now) < 7
Anyone know where I am going wrong?