Title: | MSACCESS |
Moderator: | BUMP::HONER |
Created: | Tue Dec 01 1992 |
Last Modified: | Mon Jun 02 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 1661 |
Total number of notes: | 6339 |
Hi, I'd like to find out how to go about handling this situation. I have two screens for the same table, one for entering, one for modifying (not the best design, I know ..). For the modify screen, I have a macro that tells it to bring up the first record and and to go to a specific field on the form. That all works fine, if there is a record to find. If not, I get a macro error screen and have to halt. How do I get around this 'null' table problem? I would like to bring up a message box indicating that no records were found, I'm just not sure where or how to do that .. Thanks for any help you can send my way .. Nancy
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1642.1 | DCOUNT FUNCTION | POLAR::GOSLING | KAO - 621-4519 | Tue Mar 18 1997 14:51 | 29 |
Re: <<< Note 1642.0 by TIEFLY::VARDARO >>> Nancy, Under Access Basic (V2), use the Dcount function to check for records. If there are none found then display the message box and exit the subroutine. If there are records found, then continue with the process. Code looks something like: IsRecords = Dcount("*","table_name") If IsRecords = 0 then msgbox "There are no records" exit sub else ....do whatever it is you are wanting to peform end if If you are using a macro then I think - but I'm not 100% sure as I don't use macros all that much - you use it something like: Condition Action Dcount("*","table_name") = 0 Msgbox ... CancelEvent Hope this helps or at least gets you thinking in the right direction. Art | |||||
1642.2 | thanks | TIEFLY::VARDARO | Wed Mar 19 1997 09:48 | 3 | |
Thank you! That definitely gives me a direction I can go in. Nancy |