Re: Append Query Problem - Posting record only once

Did you enter the following as ONE LINE. The newsgroup reader may have
wrapped it to TWO Lines.

If DCOUNT("SomeField", "BankingBalanceRecord", "DateField = #" & date() &
"#") = 0 then

currentdb.execute qry_BankingRecordBalance

Also there was a small error in the code, EndIf should be End If

Or try it this way with a line continuation so wrapping should not be a

If DCOUNT("SomeField", "BankingBalanceRecord", _
"DateField = #" & date() & "#") = 0 then

Currentdb.Execute qry_BankingRecordBalance
End If

That does not go in the query, but should be in a sub or function. Probably
the sub for the Open Event of a form.

Another method might be to modify your query, but to suggest an alternative
for that would require that you post the SQL of the query.
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County

<wesley.allen@xxxxxxxxx> wrote in message
I tried your suggestion. I attempted to add it into the query, in a
private sub function, and a module. Nothing seems to work. When I
enter the text, it turns red and says there is a compile error. I am
not very experienced with SQL, so I may be missing some code or not
entering it in the correct place.



Relevant Pages

  • Re: Running MSAccess Query thru ADO
    ... query in the Northwind Access MDB. ... The only modifications I made to the SQL ... Public Sub TestSub() ... Dim rst As ADODB.Recordset ...
  • Re: Update Query does not clear all records immediately
    ... To get a sample SQL statement, you can mock up a query and switch to SQL View ... Private Sub btn_ClFlag_Click ... that records Flag field does not get cleared. ...
  • Re: Selecting certain items for a report
    ... highlights the Dim qdf as DAO.QueryDef line. ... Private Sub cmdReport_Click ... 'You could delete and recreate the query each time, ... 'I generally leave the query and just modify the SQL ...
  • Re: Bug in SQL parser???
    ... SELECT SUB.* ... RES ... Unfortunately this query fails with msg SQL5001 - Column qualifier ... Is it a bug of SQL parser or I don't understand something? ...
  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...