OK I thought I had this down, but I guess it's not working...
I'm trying to run an access query from excel (the access query queries an Oracle ODBC). I know, I should query that ODBC directly, and that may be an upgrade in the future.
Anyway, I have a UserForm with 3 text boxes prompting the user for Project Number, Fiscal Year, and Accounting Period.
I then set those text boxes equal to 3 variables:
And then I recorded the code for the MS Access query and inserted the variables where I need them to be (VARIABLES IN BOLD):![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Result:
When I run this query with numerical information in place of the variables, it works great... but when I run it with the variables in the code, it gives me a "general ODBC error" and highlights the " .Refresh BackgroundQuery:=False" line... that is telling me that something is wrong with my query, but I don't understand why variables wouldn't work for parameters in the query.
Any idea how to get the user-defined variables to work as parameters in that query?
Many thanks in advance.
Bookmarks