Re: Finding the Count in an Update Query
- From: SC in Texas <SCinTexas@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Aug 2008 13:47:01 -0700
Dirk,
How do I pass through the parameter from my form to the query when I kick it
off using this method.
Thanks
--
SC from Lubbock, Texas
"Dirk Goldgar" wrote:
"SC in Texas" <SCinTexas@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message.
news:E65B9CA9-3A79-438E-AE94-A3C2A4229E80@xxxxxxxxxxxxxxxx
I have an update query that should only have 1 record to update or no
records
to update when kicked off by a command button in my form. How can I find
the
count of records to be updated to create my own message box, if the count
is
zero instead of using the warning message box that Access brings up
showing
the number of rows to be updated?
Option 2 How can I edit the message in that message box?
Thanks in advance.
If you execute the query via the DAO Execute method, rather than RunSQL or
OpenQuery, then you can examine the database's RecordsAffected property.
Thus:
With CurrentDb
.Execute "YourUpdateQuery", dbFailOnError
If .RecordsAffected = 0 Then
MsgBox "No records were updated."
Else
MsgBox "You just updated " & .RecordsAffected & " record(s)."
End If
End With
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
- Follow-Ups:
- Re: Finding the Count in an Update Query
- From: Dirk Goldgar
- Re: Finding the Count in an Update Query
- References:
- Finding the Count in an Update Query
- From: SC in Texas
- Re: Finding the Count in an Update Query
- From: Dirk Goldgar
- Finding the Count in an Update Query
- Prev by Date: Re: Single Entry vs. All Entry Coding
- Next by Date: Re: ARRRGGGHHH!! Syntax problem with requery on a form other than
- Previous by thread: Re: Finding the Count in an Update Query
- Next by thread: Re: Finding the Count in an Update Query
- Index(es):