Is there such a thing as code for "or" in the criteria field of an update query? I can use the same query to update a table based on which of 5 forms happens to be opened at the time. I would like the criteria to read something like:
WHERE ((([TBL 1].[ID]) Like [Forms]![FRM 1]![ID] Or [TBL 1].[ID]) Like [Forms]![FRM 2]![ID] Or [TBL 1].[ID]) Like [Forms]![FRM 3]![ID] Or [TBL 1].[ID]) Like [Forms]![FRM 4]![ID] Or [TBL 1].[ID]) Like [Forms]![FRM s]![ID]));
So it only uses whichever of the forms are open at the time. The only way I could see to do this is create a different query for each of the forms but wondering if I can streamline this.
Thanks
Sue
Sue,
I had a problem similar to this one (I think). The project used two Tables to store information related to Equipment that the company used. The first Table contained Standard Equipment Information that was similar for all Equipment, while the second one contained Equipment Characteristics that were different. The Equipment Characteristics Table contained a Field for each Characteristic for all possible Equipment Types that were used, and in all records, only related information had values, and as a result, most of the infomation was blank. The Tables were related on a 1:1 basis, and were split due to both the size of the Characteristics Table, and the frequency of use of the Common Equipment Information.
There was a Main Form displaying the Standard Equipment Information, and a Sub Form displaying the Equipment Characteristics. The Main Form had a Combo Box allowing selection of the Type of Equipment. Once the Type was selected, any one of 15 different Characteristics Sub Forms could be displayed. All of the Sub Forms used a commmon Equipment Number ID that referred to the ID on the main form.
This proved to be more than a little too slow, so I changed it to a Tabbed Form that had a single datasource based on the Equipment Characteristics Table. Each Tab has its own Constant value based on its Tab position. A procedure was created to determine the Selected Tab ID and display the data for the Selected Tab based on the contents of the Equipment Type Combo Box.
In the ON Open Event for the Form, the contents of all of the Tabs were hidden. If the Form was opened for Update, then the Equipment Type Characteristics display procedure was called.
In the ON Change Event for the Equipment Type Combo Box, the Equipment Type Characteristics display procedure was also called.
This allowed the proper Characteristics to be displayed at all times.
Would something like this work?
-- Rookie