My Assistant
![]() ![]() |
|
|
May 9 2005, 11:15 AM
Post
#1
|
|
|
UtterAccess VIP Posts: 9,209 From: Maryland |
I have a form (single) where the user enters their search criteria and then opens another form (Continuous) where they mark if a request was completed or rejected. Is there a way I can check to see if this second form has data before it is opened. I know HasData is only for reports, but I was wondering if they have anything similar for forms.
Thanks. |
|
|
|
May 9 2005, 11:24 AM
Post
#2
|
|
|
UA Editor + Utterly Certified Posts: 22,722 From: Melton Mowbray,Leicestershire (U.K) |
Hi
Try this on the open event: CODE If Me.RecordsetClone.RecordCount = 0 Then MsgBox "No records for that parameter", vbInformation + vbOKOnly, "No records" Cancel = True End If (IMG:http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif) |
|
|
|
May 9 2005, 11:36 AM
Post
#3
|
|
|
UtterAccess VIP Posts: 9,209 From: Maryland |
Thanks Larry. That works from keeping the second form from opening. However, now I'm getting a Run Time 2501 error on the first form's button Onclick event. I'm assuming it has to do with the code I'm using to open the second form:
QUOTE DoCmd.OpenForm "sfrmProcessWriteoffRequests", , "", "", acFormPropertySettings Can you see what I'm doing wrong? Thanks. |
|
|
|
May 9 2005, 12:34 PM
Post
#4
|
|
|
UA Editor + Utterly Certified Posts: 22,722 From: Melton Mowbray,Leicestershire (U.K) |
Hi
Just puzzled as to why you have quotes in the two arguments (filtername,wherecondition) (IMG:http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif) |
|
|
|
May 9 2005, 02:54 PM
Post
#5
|
|
|
UtterAccess VIP Posts: 9,209 From: Maryland |
I realized my mistake (I was still working in the second form's OnActivate event rather then the onOpen event.
Actually, I did get rid of those quotes, however, I was under the impression that if you weren't using arguments, but were using latter arguments in the string, you had to put "" in there for it to pass through. From your question, I'm assuming this is not the case. Thanks. William. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 22nd May 2013 - 08:58 AM |