Hi All.
I've encountered a problem I do not understand, and seeking for advice from people who do.
In a frmChooseBooks which is bound to qryChooseBooks, I have an unbounded cmbCountrycontrol, an anbounded cmbAuthor control, and bounded [BookName] and [ChooseBook] control.
(Logically, each country has several authors, and each author has several books)
qryBooks is based on tblBooks which has [CountryId],[AuthorId],[BookName],[ChooseBook] fields.
I also created global functions in public module to simplify the task of specifying the criteria for different queries used for the form:
same for fAuthor()
But when I use fCountry() or fAuthor() to specify the criteria in qryChooseBooks, or when I use fCountry() to specify the criteria for cmbAuthor (to filter only the authors who are in the selected country) I get the following error:
Run-time error '2186'
This property isn't available in Design view.
with the debugger going straight to that public function.
When I use fCountry() to specify the default value of cmbAuthor(), the value doesn't get set.
Only when I use the full control name - [Forms]![frmChooseBooks]![cmbCountry] in queries and default value fields do I get the results.
Is it possible to use functions (as shortcuts) for the control values and make it work?
Need advice,
inso18.
I've encountered a problem I do not understand, and seeking for advice from people who do.
In a frmChooseBooks which is bound to qryChooseBooks, I have an unbounded cmbCountrycontrol, an anbounded cmbAuthor control, and bounded [BookName] and [ChooseBook] control.
(Logically, each country has several authors, and each author has several books)
qryBooks is based on tblBooks which has [CountryId],[AuthorId],[BookName],[ChooseBook] fields.
I also created global functions in public module to simplify the task of specifying the criteria for different queries used for the form:
Code:
Function [b]fCountry()[/b]
fCountry = Forms!frmChooseBooks!cmbCountry
End Function
But when I use fCountry() or fAuthor() to specify the criteria in qryChooseBooks, or when I use fCountry() to specify the criteria for cmbAuthor (to filter only the authors who are in the selected country) I get the following error:
Run-time error '2186'
This property isn't available in Design view.
with the debugger going straight to that public function.
When I use fCountry() to specify the default value of cmbAuthor(), the value doesn't get set.
Only when I use the full control name - [Forms]![frmChooseBooks]![cmbCountry] in queries and default value fields do I get the results.
Is it possible to use functions (as shortcuts) for the control values and make it work?
Need advice,
inso18.