473,408 Members | 2,832 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,408 software developers and data experts.

Getting Rid of #Error

Hello,

I need help on getting rid of #Error in my fields on a form when no data exist. I was using the below formula:

="" & [System]

and when #Error showed I switched over to

=IIf(IsNull([System])," ",[System])

and that came up with the same results. If data exist it works fine but when data is not there I want it to be blank or say "No data exist".

What formula can I use in the control source to fix this. Any assistance would be most appreciative.

Thanks
Mar 15 '08 #1
16 1711
missinglinq
3,532 Expert 2GB
What exactly is [System]? What Datatype?

Welcome to TheScripts!

Linq ;0)>
Mar 15 '08 #2
janders468
112 Expert 100+
I'm trying to duplicate this error to see if I can fix it, what data type is your [System] Column?
Mar 15 '08 #3
I'm trying to duplicate this error to see if I can fix it, what data type is your [System] Column?
Sorry about the slow response but two are of text and one is Date/Time.

It looks like this

="of " & [StudentCompany]

="" & [System]

=" on " & [GraduationDate]

Let me know what you come up with.

Thanks
Mar 16 '08 #4
What exactly is [System]? What Datatype?

Welcome to TheScripts!

Linq ;0)>
I'm sorry Linq, but System is one of the fields from table1 used on the form and DataType is text.

Thanks for the fast response sorry couldnt say the same but step out a bit, didnt think anyone would respond back so quick.
Mar 16 '08 #5
NeoPa
32,556 Expert Mod 16PB
David,

I've tried various approaches but was unable to duplicate your problem in any of them I'm afraid.

It appears there's some quite fundamental information that you haven't included in the question. I can't tell you what it may be, but this isn't standard behaviour in a form to report #Error simply because a field has no data.
Mar 16 '08 #6
David,

I've tried various approaches but was unable to duplicate your problem in any of them I'm afraid.

It appears there's some quite fundamental information that you haven't included in the question. I can't tell you what it may be, but this isn't standard behaviour in a form to report #Error simply because a field has no data.

NeoPa,

I miss quoted before in saying it was a form, in fact it is a report. I am missing something but cant figure it out.

David
Mar 16 '08 #7
NeoPa
32,556 Expert Mod 16PB
I think the matching answer is :
Expand|Select|Wrap|Line Numbers
  1. =IIf(IsError([System]),'',[System])
Mar 16 '08 #8
NeoPa
32,556 Expert Mod 16PB
Should the question rather be though :
How do I stop a report from running if there are no matching records?

If so, the answer is that there is an On No Data event.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_NoData(Cancel As Integer)
  2.  
  3. End Sub
This allows code to run informing the operator of the situation as well as allowing the report to be cancelled entirely (Set Cancel to True before exiting procedure).
Mar 16 '08 #9
Should the question rather be though :
How do I stop a report from running if there are no matching records?

If so, the answer is that there is an On No Data event.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_NoData(Cancel As Integer)
  2.  
  3. End Sub
This allows code to run informing the operator of the situation as well as allowing the report to be cancelled entirely (Set Cancel to True before exiting procedure).
Thanks NeoPa,

Good solution but how do you set it to true.

David
Mar 16 '08 #10
NeoPa
32,556 Expert Mod 16PB
At its simplest :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_NoData(Cancel As Integer)
  2.   Cancel = True
  3. End Sub
Mar 17 '08 #11
Scott Price
1,384 Expert 1GB
Have a look at Avoid #Error in Form/Report with no data on Allen Browne's website.

Regards,
Scott
Mar 17 '08 #12
Have a look at Avoid #Error in Form/Report with no data on Allen Browne's website.

Regards,
Scott

Thanks for the information.

David
Mar 17 '08 #13
At its simplest :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_NoData(Cancel As Integer)
  2.   Cancel = True
  3. End Sub
NeoPa,

Thanks, that worked perfectly I have just one more question. How can you make Microsoft Access close the same time the database closes.

David
Mar 17 '08 #14
NeoPa
32,556 Expert Mod 16PB
There's no really direct way, but if you cause an invisible form to open when you open the database (Tools / Startup...) then you can leave it running in the background while the database is open.

In the Form_Close() event procedure you can then call a close of Access itself :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Close()
  2.   Call Application.Quit
  3. End Sub
Mar 17 '08 #15
NeoPa,

I can definitely say you are the expert. Everything work like you said and I appreciate your help. I am just about done. Can you throw me another bone on another stump I hit. ...
** Edit **
Question asked in new thread - see next post.

David.
Mar 18 '08 #16
NeoPa
32,556 Expert Mod 16PB
Thank you for your comments David.

I have split off the extra question into its own thread (Select Report to Open by CheckBox) as explained in the thread.
Mar 18 '08 #17

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

Similar topics

3
by: IMS.Rushikesh | last post by:
Hi Friends, My work is stuck up because of this unresolvable and unbelievable Error. I'm trying to Serialize my Class object using XmlSerialization. And at below line, I m getting "error File...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
5
by: Archana | last post by:
Hi all, I am having application where i am downloading xml content using webrequest. my code is as below HttpWebRequest lWebRequest = (HttpWebRequest) WebRequest.Create(URL); HttpWebResponse...
1
by: jonny | last post by:
Went from using Visual Web Develop express to Visual Studio 2005 and getting error when trying to open project. Error message: "One or more projects in the solution could not be loaded for the...
21
vikas251074
by: vikas251074 | last post by:
I am getting error while entry in userid field. When user enter his user id, an event is fired immediately and user id is verified using AJAX method. But I am getting error 'Object doesn't support...
2
by: sony.m.2007 | last post by:
Hi, When i try to set a value for a session variable I'm getting a object refence not set error I tried two methods as below HttpContext.Current.Session.Add("AppStartTime", DateTime.Now);...
4
by: sumit kale | last post by:
Hi, Can somebody help me resolve my problem ? I am getting error when calculating total using unbound textfiled in subform. I have a main form called purchase_register_master and a subform...
12
by: tvnaidu | last post by:
Trying to mount windows folder on Linux machine, getting this error. I have a folder called "CheckIn" on windows, I made that folder as Network sharing. ON lInux, I tried to access that folder by...
2
by: bandy | last post by:
Hi there sorry If I posted this thread under wrong head. When I am trying to run my site I am getting error as Internal Server Error, but when I refresh page , i get result properly. I don't...
1
by: NareshN | last post by:
Hi, I am getting error in following stored procedure in where condition Must declare the scalar variable "@CampaignId".I already declared CampaignId but still getting error.Please see where...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.