A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

MassageBox



 
 
Thread Tools Display Modes
  #1  
Old May 23rd, 2010, 08:39 AM posted to microsoft.public.access.gettingstarted
Achit via AccessMonster.com
external usenet poster
 
Posts: 4
Default MassageBox

I create a program Audit Tools...and I want Make MassageBox if my subform
empty...I want make massagebox "No Data Found"...What Should I do????

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/201005/1

  #2  
Old May 23rd, 2010, 06:26 PM posted to microsoft.public.access.gettingstarted
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default MassageBox

Hi

You will be able to see if a subform has no records so I don't understand
why you would need a message popup also ???

But if you really want a popup then you'll need to count the records that
should go into the subform and if the answer is 0 then you have the massage
popup.

Something like this will do

Dim rsClone as Recordset
set rsClone =
Forms![YourMainFormName..]![YourSubformName..].Form.RecordsetClone
if rsClone.recordcount = 0 then
MsgBox "Hi, I don't have any records", vbInformation, "Subform has a problem"
end if
set rsClone = Nothing

Of course change
YourMainFormName and YourSubformName
to what they really are.

Hope this helps


--
Wayne
Manchester, England.



"Achit via AccessMonster.com" wrote:

I create a program Audit Tools...and I want Make MassageBox if my subform
empty...I want make massagebox "No Data Found"...What Should I do????

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/201005/1

.

  #3  
Old May 24th, 2010, 08:24 PM posted to microsoft.public.access.gettingstarted
Larry Linson
external usenet poster
 
Posts: 3,112
Default MassageBox

Usually massages are done on a table or in a special chair, not in a box.
"Message Box", however, is almost universally understood when abbreviated as
"MsgBox".

If the OP really wants a MsgBox if there are no records to display in the
Subform, this code in the Load Event of the Form embedded in that Subform
Control should do the trick. If the OP is displaying a datasheet instead of
a form, he/she shouldn't be.

Private Sub Form_Load()
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "The Subform Has No Records"
End If
End Sub

--
Larry Linson, Microsoft Office Access MVP
Co-author: "Microsoft Access Small Business Solutions", published by Wiley
Access newsgroup support is alive and well in USENET
comp.databases.ms-access


"Wayne-I-M" wrote in message
...
Hi

You will be able to see if a subform has no records so I don't understand
why you would need a message popup also ???

But if you really want a popup then you'll need to count the records that
should go into the subform and if the answer is 0 then you have the
massage
popup.

Something like this will do

Dim rsClone as Recordset
set rsClone =
Forms![YourMainFormName..]![YourSubformName..].Form.RecordsetClone
if rsClone.recordcount = 0 then
MsgBox "Hi, I don't have any records", vbInformation, "Subform has a
problem"
end if
set rsClone = Nothing

Of course change
YourMainFormName and YourSubformName
to what they really are.

Hope this helps


--
Wayne
Manchester, England.



"Achit via AccessMonster.com" wrote:

I create a program Audit Tools...and I want Make MassageBox if my subform
empty...I want make massagebox "No Data Found"...What Should I do????

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/201005/1

.



  #4  
Old May 27th, 2010, 10:14 PM posted to microsoft.public.access.gettingstarted
adrianna billings
external usenet poster
 
Posts: 2
Default MassageBox

wrote in message news:a86c54182956a@uwe...
Have you ever had sex it feels good.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:04 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.