Reputation:
Need help with script-string. An Excel sheet I import into Access has a text field that always starts with a number or range of numbers like: '312' or '312-337'. This field and others are on a form. I need to open that form with a condition based on the number or range. So, my Where Condition [Enter Number or Range] = [text field with this number or range]..... Could someone please help me with this second half of the condition of the text field, to open only records based on user entry of the number of range of numbers.
Thank you
Upvotes: 0
Views: 54
Reputation: 365
As @David-W-Fenton suggested, this is not possible with a simple query parameter because your operators aren't static. Meaning, sometimes you'll need to use >= [some #] and <= [some #], whereas other times you want only a specific number, and even other times you'll need a combination of the two.
So, the only way I see to accomplish this is to create the SQL statement and where clause through vba, then set that as the recordsource to your form or query at the OnOpen event.
Upvotes: 1