Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 access 2003 to display record count in message box

Author  Topic 

oggy
Starting Member

3 Posts

Posted - 2010-12-08 : 07:25:31
I want to display the number of records found (if 2 or more), of a query result, in a message box. Code using at the moment on the Form Load:

If Me.RecordsetClone.RecordCount >= 2 Then
MsgBox "More Than One ASO Has Been Found - Enter Details For The Relevant ASO's.", vbInformation, "More records"

End If


This does not seem to do anything. What am i doing wrong. I am new to Access.

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2010-12-08 : 07:33:24
Post in the access forum rather than sql server?

Do you have a msgbox statement working at all?
Do you have it working in a form load module?
if yes + yes try removing the if statement - could be that the record count isn't avaiable yet (until recorset closed) and you are geting 0.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

oggy
Starting Member

3 Posts

Posted - 2010-12-08 : 07:50:40
Hi thanks for your prompt reply. Sorry for incorrect post. I will continue in the access forum.

quote:
Originally posted by nigelrivett

Post in the access forum rather than sql server?

Do you have a msgbox statement working at all?
Do you have it working in a form load module?
if yes + yes try removing the if statement - could be that the record count isn't avaiable yet (until recorset closed) and you are geting 0.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.

Go to Top of Page
   

- Advertisement -