cyberbiker
Programmer
This has probably been answered before, but I cannot seem to find anything on it.
Please note, this is NOT connected to my other post (Firing blanks).
But how do I change a forms record source "on the fly".
I have a search form where one of 3 option buttons may be selected. The first 2 option buttons are to search a customer data base by either id number or name. Once selected the value of this control is used as the criteria in a query which is the record source of another form (which uses bound controls). Works fine
When the 3rd option button is selected, the search is by a return authorization number.
This is done by a combo box looking up values in a table.
The value of that combo box is the criteria in another query
which is identical to the first query except for the criteria.
Depending on which option is selected, I then open frmRmv1 or frmRmv2 with the record source set to qRmv1 or qRmv2 respectively. This works well, but somehow seems like the long way around the block.
The issue appears to my eyes that the query runs at the start of the load event and I cannot change the record source property until the form is loaded.
Is this a correct assumption and if so how do I get around it?
Terry (cyberbiker)
Please note, this is NOT connected to my other post (Firing blanks).
But how do I change a forms record source "on the fly".
I have a search form where one of 3 option buttons may be selected. The first 2 option buttons are to search a customer data base by either id number or name. Once selected the value of this control is used as the criteria in a query which is the record source of another form (which uses bound controls). Works fine
When the 3rd option button is selected, the search is by a return authorization number.
This is done by a combo box looking up values in a table.
The value of that combo box is the criteria in another query
which is identical to the first query except for the criteria.
Depending on which option is selected, I then open frmRmv1 or frmRmv2 with the record source set to qRmv1 or qRmv2 respectively. This works well, but somehow seems like the long way around the block.
The issue appears to my eyes that the query runs at the start of the load event and I cannot change the record source property until the form is loaded.
Is this a correct assumption and if so how do I get around it?
Terry (cyberbiker)