I have a form that I allow users to update record information. It will update the temp table I use to store the data until the user wants to process it but it wont update the main table.
Here is how it works:
- From a form a user selects a car
- This form uses an append query to add that car record to a temp table
- It then opens another form that has a field for each record in the table
- The user can enter new values in the field and click a button to update the temp table. This button updates the record and then opens the table in datasheet view so they can see the changes they made.
- If the user is ready to make the changes they click another button that will update the details from the temp table to the main table
The update of the temp table works fine, however, when it tries to update the main table it doesn't work. I use the same if statement to update both tables:
Update to the temp table
IIf([Forms]![DataEntry]![Available] Is Null,[temptable].[Available],[Forms]![DataEntry]![Available]) - this one works fine and will update and change correctly
The final update is to the main table
IIf([Forms]![DataEntry]![Available] Is Null,[maintable].[Available],[temptable].[Available]) - This one does not work
I have confirmed the following:
Main table is yes/no - format yes/no -lookup checkbox
temp table is yes/no - format yes/no -lookup checkbox
Tried changing to yes/no - format yes/no - lookup text box and no difference
So both field types are the same and on the update form it is a checkbox as well. I use a triple state check box on the update form so that the user can leave it at its current value. I have tested and it works correctly on the temp table
Does anyone have any ideas why this does not work for the final update query?
The working query has only one table in the query - temptable
the non working query has two tables - main table and temp table with a left join on railcar id
Last note this works for all the regular text fields, the only thing not working is the yes/no fields