I have an append query that needs to stop if nothing is entered in the date field. What criteria should I use. Will is stop the query and continue?
I have an append query that needs to stop if nothing is entered in the date field. What criteria should I use. Will is stop the query and continue?
In what date field - do you mean a control on form? Are you running an Access query object? I only run action queries in VBA, like:
If Not IsNull(Me.control3) Then
CurrentDb.Execute "INSERT INTO tablename(field1, field2, field3) VALUES(" & Me.control1 & ", '" & Me.control2 & "', #" & Me.control3 & "#")
End If
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I have a form that saves selected and imputted data into a temp table. Then an append query transfers the data into a main table. The user inputs date and a short note.
The button that activates the query can be pushed without a date entered and puts partial data into table. I want the query to stop if no date is put in.
Use conditional code like my example.
Or set the button as disabled and code will enable it only if valid date entered.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I got it. Just had to put Is Not Null in the criteria field on the query.