Conditionally halt an append query from working

Skip Bisconer

Who Me?
Local time
Today, 01:23
Joined
Jan 22, 2008
Messages
285
I have severl queries based on a linked Excel files that when all the information is present the user is able to run the query from a control on the form. The query appends this data to a history table. These queries have multiple lines and one of the fields have numbers from 0 (incomplete) to anything greater than 0 (complete).

I would like to beable to stop the user from appending this record until every row in that field is greater than 0. I hope I am making sense here.
 
Skip,

You can use the DCount function to check either the queries, or the tables
(if the Excel data is imported.

Code:
If DCount("[ThatField]", "OneOfYourQueries", "[ThatField] = 0") > 0 Then
   MsgBox "Can't move to history table ..."
Else
   ' Run the Append query
End If

Wayne
 

Users who are viewing this thread

Back
Top Bottom