I have a few text boxes that have values assigned to them. I want to be able to filter and sort based on those values in the them, but I can't seem to figure out a way.
Let's say I have a Textbox called EndTime. This is not a field in the table, it is a text box taking the value of StartTime, a field in the table, plus an hour. Don't tell me to just filter based on the start time, since this is just an example, and I want to know how to do it with the textbox.
So this is what I would use to filter:
DoCmd.ApplyFilter , "EndTime < Now()"
This would prompt me for the value of EndTime, since it doesn't realize it is a textbox. It must be looking for a table field called EndTime, but there isn't one.
This is what I would use to sort it ascending:
DoCmd.SetOrderBy "EndTime ASC"
This would do nothing.
I've been looking all over for a way to reference a textbox in these commands, but I can't seem to find anything. Is it only possible to reference table fields here? If so, please let me know, so I can rethink how I am doing this.