For the record:
I had a form where users are putting in time worked for a company. The actual date and time and company were being entered on a subform, and on the main form they were submitting the data. The data was being sent to a Temp table if they did not hit submit, but when they hit submit the records were being appended to a Service table and deleted from the Temp table.
I needed to make sure specific company ID's were not submitted. Using the DCount() function, I counted the number of rows from the temp table that had the company ID. If that was > 0, I needed to catch it. Also, I have different employees that are going to be working. I also added the Staff ID from the Temp table to the WHERE expression in the DCount function so I could allow John Smith's records to be submitted if there was nothing wrong, but withhold Mary Beth's if she had that company ID I was wanting to catch.
Hope this helps someone.
I had a form where users are putting in time worked for a company. The actual date and time and company were being entered on a subform, and on the main form they were submitting the data. The data was being sent to a Temp table if they did not hit submit, but when they hit submit the records were being appended to a Service table and deleted from the Temp table.
I needed to make sure specific company ID's were not submitted. Using the DCount() function, I counted the number of rows from the temp table that had the company ID. If that was > 0, I needed to catch it. Also, I have different employees that are going to be working. I also added the Staff ID from the Temp table to the WHERE expression in the DCount function so I could allow John Smith's records to be submitted if there was nothing wrong, but withhold Mary Beth's if she had that company ID I was wanting to catch.
Hope this helps someone.