Hi!
I am trying to create a 'search form' for querying one of my databases. First off, I have a combo box which selects the fields I need to search on. I then have a second combo box which runs a DISTINCT query on this field. For example, the table is called 'tbl_Desktops' and contains information about desktop PC's at our company. The first combo box displays the fields for this table. For example, if you select 'Model' from the first combo, the second combo box is automatically populated with DISTINCT model numbers from the model field. When a user selects a model number from the second combo, the results for all the 360 machines are displayed.
My problem is this:
I have text, date/time and yes/no fields in the table. I need to determine what the field data type is before I return the results so I can generate the SQL properly. For example, if I'm searching for all models (which is a text data type), I have to enclose it in speech marks. If is is a yes/no field or a date/time field, I need to remove the speech marks otherwise a data type mismatch error occurs.
I know this is a tricky one to understand (?), but I would be grateful for any feedback.
Thanks, Scoobey....
I am trying to create a 'search form' for querying one of my databases. First off, I have a combo box which selects the fields I need to search on. I then have a second combo box which runs a DISTINCT query on this field. For example, the table is called 'tbl_Desktops' and contains information about desktop PC's at our company. The first combo box displays the fields for this table. For example, if you select 'Model' from the first combo, the second combo box is automatically populated with DISTINCT model numbers from the model field. When a user selects a model number from the second combo, the results for all the 360 machines are displayed.
My problem is this:
I have text, date/time and yes/no fields in the table. I need to determine what the field data type is before I return the results so I can generate the SQL properly. For example, if I'm searching for all models (which is a text data type), I have to enclose it in speech marks. If is is a yes/no field or a date/time field, I need to remove the speech marks otherwise a data type mismatch error occurs.
I know this is a tricky one to understand (?), but I would be grateful for any feedback.
Thanks, Scoobey....