473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

No Records Found

I am trying to code a custom dialog when "No Records Are Found" on a Find button.

This is the code I have so far -- I'm getting an error 91:

Function NoRecordsFound()

On Error GoTo Error_Handler:

Dim rstFees As Recordset

rstFees.MoveLast

If rstFees.RecordCount = 0 Then
MsgBox "Sorry no records found."

End If

rstFees.Close

Exit Function

Error_Handler:
MsgBox Err.Description & Err.Number

End Function
==
Thanks!

amy
=
Nov 13 '05 #1
1 1845
amywolfie wrote:
I am trying to code a custom dialog when "No Records Are Found" on a
Find button.

This is the code I have so far -- I'm getting an error 91:

Function NoRecordsFound()

On Error GoTo Error_Handler:

Dim rstFees As Recordset

rstFees.MoveLast

If rstFees.RecordCount = 0 Then
MsgBox "Sorry no records found."

End If

rstFees.Close

Exit Function

Error_Handler:
MsgBox Err.Description & Err.Number

End Function
==
Thanks!

amy
=


You haven't Set rstFees to anything.

e.g Set rstFees = Me.recordsetclone

Also I think rstFees.MoveLast might throw up an error if there are no
records but you should set the recordset variable first and then try again..
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Reply via newsgroup | last post by:
Folks, When performing an update in mysql (using PHP), can I find out how many records were matched? mysql_affected_rows() won't work... and I have the following problem that I thought I...
28
by: Lee Rouse | last post by:
Hello all, This is going to be a rather lengthy "question". I have an Access 2k database, separated front end/back end. Front end copies are on about 30 workstations and used frequently during...
2
by: amywolfie | last post by:
I would like to place a Find button on a form which uses the built-in Access Find facility. If no records are found, I would like to display a custom "no records found - plesae try again" message...
4
by: amywolfie | last post by:
I would like to put code behind a Find button on a form which: 1) Performs a find based on a field on the form 2) If NO RECORDS ARE FOUND, then displays a custom "No Records Found" message box. ...
6
by: Sven Pran | last post by:
Probably the answer is there just in front of me only awaiting me to discover it, but: 1: I want to build a query that returns all records in one table for which there is no successful "join"...
7
by: Ray | last post by:
I have a input form linked to a table and found the total no of records on the bottom bar is different from that of table. Can someone advise an effective way to find out the different records...
0
by: brown3313 | last post by:
I am new to this. Someone please help. I am creating stored procedures that queries the tables to pull certain information together in a listing (report). I would like to be able to print to the...
2
by: brown3313 | last post by:
I am new to this. Someone please help. I am creating stored procedures that queries the tables to pull certain information together in a listing (report). I would like to be able to print to the...
5
by: Neil | last post by:
I'm running Access 2000 with a SQL 7 back end, using ODBC linked tables in an MDB file. The db is used by about 30 users on a LAN, and an additional 10 or so on a WAN. Recently, one of the WAN...
5
kcdoell
by: kcdoell | last post by:
Hello: I am trying to write a code that will delete all records found in my DAO recordset Below is the code I have so far: 'Procdure to give the user the ability to delete all records 'for a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.