Possible to set the parameters of a bound query in vba before form load?
ms-access
Solution
You said:
at the moment I use unbound forms during designtime and bind them to parameterqueries during runtime. but having unbound forms during designtime is not so handy.
One alternative would be to use a "dummy" RecordSource so that you have a bound form at design time, but still update the RecordSource using your parameter query at runtime.
An example of a dummy query would be something like this:
SELECT 1 AS EmployeeID, 'John' AS FirstName, 'Doe' AS LastName, #1/1/1980# AS DoB
That would populate the Field List box with the fields `EmployeeID`, `FirstName`, `LastName`, `DoB`. Obviously you would want your dummy query field names to reflect what the field names will be at runtime.
This will also avoid the issue of the parameter pop-ups showing at load time.
Problem
I've a bound form. The datasource for the form is a query with parameters. Is it possible to set the parameters in vba before the form loads? The popup for the parameters pops up even before the form_open event :/ I know of the alternatives .. build my own query strings with parameters, or manipulate the sql of the querydefs. but i dont like them. at the moment I use unbound forms during designtime and bind them to parameterqueries during runtime. but having unbound forms during designtime is not so handy. Anyone an idea? Greetings Egi