Dear Bytes community,
Framework: I have an SQL statment in a public function at a module. This fuction will be used in different forms to populate Comboboxes. My question is:
- Is it possible to use a string instead of a field in the criteria of the SQL statment? The goal was to change only the argument of my Public Function in order to populate my combobox, depending on the form.
Problem: Using the code on the example bellow, Access cannot identify the field.
Simple debug example:
Thank you in advance for the help.
Best regards.
Framework: I have an SQL statment in a public function at a module. This fuction will be used in different forms to populate Comboboxes. My question is:
- Is it possible to use a string instead of a field in the criteria of the SQL statment? The goal was to change only the argument of my Public Function in order to populate my combobox, depending on the form.
Problem: Using the code on the example bellow, Access cannot identify the field.
Simple debug example:
Code:
MyField = "Completed" 'Completed is a field of tbValve strSQL = "Select [ValveName] from tbValve Where MyField Is Null"
Best regards.
Comment