473,474 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Checking if SourceObject has no records

Breezwell
33 New Member
First off, let me say that this forum has provided me with numerous guidance to Access programming challenges I have faced while learning, and I am grateful to all those who share thier knowledge with others.

My current question involves SourceObjects. I have a form that has three SourceObjects, each of which displays the results of a query designed just for that particular SourceObject. Each SourceObject will reaveal information from a table that also supports just that particular SourceObject.

For example....

Table1 = SourceObject1
Table2 = SourceObject2
Table3 = Source Object3

After the queries run, each SourceObject is revealed on a form with the visible property set to True. Basically, I would like to only show SourceObjects that have actual data in them based on the current query. So, if only Table1 data is returned, I only want to show SourceObject1.

Is there a way to check if a SourceObject is empty and only include it on the form if it holds data?

Thanks for any replies and I can try to clarify further if need be.
Sep 19 '08 #1
3 1899
ADezii
8,834 Recognized Expert Expert
After the queries run, each SourceObject is revealed on a form with the visible property set to True.
I'm a little confused on exactly what you mean by this, please clarify the above statement, and also explain exactly what you mean by 'SourceObject'.
Sep 19 '08 #2
Breezwell
33 New Member
I'm a little confused on exactly what you mean by this, please clarify the above statement, and also explain exactly what you mean by 'SourceObject'.
Thanks for the reply ADezzi.
I am a little confused as well, so I guess it is showing in my descriptions.

Basically I have a single form with three subforms attached in a hidden state. Each subform has its SourceObject property set to a unique query.

For example, Me.AuditQueryNA.SourceObject = "query.AuditQuery"

All three queries run when a single button is clicked. I would like to somehow reveal, or include on the page ideally, only those subforms that have data in the SourceObjects query result set.

I am thinking this would require some conditional checking on the query result set or SourceObject property?

Hope this makes more sense.

Thanks
Sep 19 '08 #3
Breezwell
33 New Member
Okay, with a little digging, and this site nonetheless, I found a solution posted by Trevor Best that I modified slightly.

Basically the solution involves putting the subform reference in a conditional that utilizes the DCount funtion to inspect the queries results:

I first assinged the query to the subforms SourceObject and then checked the queries resultset. Works perfectly.

Me.AuditQueryFTOSubform.SourceObject = "query.AuditQuery3"
If DCount("*", "AuditQuery3") = 0 Then
Me.AuditQueryFTOSubform.Visible = False
Else
Me.AuditQueryFTOSubform.Visible = True
End If

Hope this helps someone else down the road.
Sep 19 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Sue | last post by:
As soon as a character is entered in the first field of a new record, the number of records shown in the navigation buttons increases by 1 and the new record button becomes enabled. In the...
3
by: Nathan Bloomfield | last post by:
Hello, I have just changed some functionality in a form which has totally screwed up the subform. form: subfrmLoadsheets subform: subfrmLoadsheetsEquipment (Child/Master - TransactionID) ...
3
by: CSDunn | last post by:
Hello, I currently have an Access 2003 ADP Report/Subreport set up in which I have 12 subreports in a single main report that are located in a group header called 'PermnumHeader' (Permnum would be...
2
by: Peter D | last post by:
in access 97 on form open i have : Me!frmContent.SourceObject = "frmabout" Me!frmmenustart.SourceObject = "frmmenuaanmelden" '"frmmainmenulist" where frmcontent and frmmenustart are two...
5
by: Bill Stock | last post by:
I'm inherited a database that has a few issues. One of the less severe issues, but the one the users bitch about is the speed across the LAN. So I thought that I could unbind the NUMEROUS subforms...
4
by: Peter D | last post by:
In Access 97 I use Forms!Frmmain!Frmcontainer.sourceobject = "FrmWhateverform" So I don't close forms, i just change the frmcontainer's source. Is there something similar in VB.net? And how does...
9
by: robert d via AccessMonster.com | last post by:
I'm not sure why the following isn't working. The subform loads correctly, but no data is displayed. I'm certain that there is data and I have checked that the SQL statement does in fact return...
4
by: joanWilder | last post by:
Hello. I am using MS Access 97 at work and trying to do the following... I have a main form which has several combo boxes, 2 buttons (search and refresh) and an unbound subform on it. This form...
4
by: abdul razak | last post by:
delete multiple records by checking checkboxes records from database use javascript
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.