Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

Hiding Errora in Form Field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
khashid - 24 May 2007 12:48 GMT
I have a form and subform. In the subform I have made a textbox "SubCount"
that counts the number of records.
On the main form I have created a new textbox "MainCount" and linked it to
the textbox in subform SubCount. so it shows the same record.

The issue am facing is that SubForm is based on a query and search fields.
Sometime the Subform is Blank means when can not find any date. When the
Subform is free the MainCount shows me erros "#Error". How can I hide that
error message so it can be 0 or Just simply blank when Subform has no data
Ofer Cohen - 24 May 2007 14:04 GMT
Try using the function IsError

=IIf(IsError([SubFormName].Form.[TextBoxName]) , 0 ,
[SubFormName].Form.[TextBoxName])

Signature

Good Luck
BS"D

> I have a form and subform. In the subform I have made a textbox "SubCount"
> that counts the number of records.
[quoted text clipped - 5 lines]
> Subform is free the MainCount shows me erros "#Error". How can I hide that
> error message so it can be 0 or Just simply blank when Subform has no data
khashid - 24 May 2007 14:41 GMT
I already have following as control source

=[CSRInbound Subform].Form!Count

>Try using the function IsError
>
[quoted text clipped - 6 lines]
>> Subform is free the MainCount shows me erros "#Error". How can I hide that
>> error message so it can be 0 or Just simply blank when Subform has no data
Ofer Cohen - 24 May 2007 15:15 GMT
Not sure what you are trying to tell me, did you try the IsError?

e.g:
In the sub form create a text box, in the control source write
=Count(*)

That wil return the number of records in the sub form
*****************************************
In the main form create a text box, in it write
=IIf(IsError([CSRInbound Subform].Form!TextBoxName,0,[CSRInbound
Subform].Form!TextBoxName)

It will replace the error with 0

Signature

Good Luck
BS"D

> I already have following as control source
>
[quoted text clipped - 10 lines]
> >> Subform is free the MainCount shows me erros "#Error". How can I hide that
> >> error message so it can be 0 or Just simply blank when Subform has no data
khashid - 24 May 2007 15:46 GMT
If i use IIF , and count the records in subform if they r above 0 then gives
me the count if <0 then shows me "0" . is that possible?

>Not sure what you are trying to tell me, did you try the IsError?
>
[quoted text clipped - 15 lines]
>> >> Subform is free the MainCount shows me erros "#Error". How can I hide that
>> >> error message so it can be 0 or Just simply blank when Subform has no data
Ofer Cohen - 24 May 2007 15:15 GMT
Not sure what you are trying to tell me, did you try the IsError?

e.g:
In the sub form create a text box, in the control source write
=Count(*)

That wil return the number of records in the sub form
*****************************************
In the main form create a text box, in it write
=IIf(IsError([CSRInbound Subform].Form!TextBoxName),0,[CSRInbound
Subform].Form!TextBoxName)

It will replace the error with 0

Signature

Good Luck
BS"D

> I already have following as control source
>
[quoted text clipped - 10 lines]
> >> Subform is free the MainCount shows me erros "#Error". How can I hide that
> >> error message so it can be 0 or Just simply blank when Subform has no data
khashid - 24 May 2007 15:39 GMT
I did the same but it gives me erroe #Name, if i remove IsError then it just
simply gives me "0"

>Not sure what you are trying to tell me, did you try the IsError?
>
[quoted text clipped - 15 lines]
>> >> Subform is free the MainCount shows me erros "#Error". How can I hide that
>> >> error message so it can be 0 or Just simply blank when Subform has no data
khashid - 24 May 2007 15:47 GMT
If i use IIF , and count the records in subform if they r above 0 then gives
me the count if <0 then shows me "0" . is that possible?

>I did the same but it gives me erroe #Name, if i remove IsError then it just
>simply gives me "0"
[quoted text clipped - 4 lines]
>>> >> Subform is free the MainCount shows me erros "#Error". How can I hide that
>>> >> error message so it can be 0 or Just simply blank when Subform has no data
Dirk Goldgar - 24 May 2007 23:22 GMT
> I have a form and subform. In the subform I have made a textbox
> "SubCount" that counts the number of records.
[quoted text clipped - 6 lines]
> How can I hide that error message so it can be 0 or Just simply blank
> when Subform has no data

http://www.mvps.org/access/forms/frm0022.htm
Forms: #Error when the Subform has no records

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

khashid - 26 May 2007 09:30 GMT
This is excellent, can you tell me where should i put this code, on the main
or subform, can I use it "On Load" of subform or main form?

>> I have a form and subform. In the subform I have made a textbox
>> "SubCount" that counts the number of records.
[quoted text clipped - 4 lines]
>http://www.mvps.org/access/forms/frm0022.htm
>Forms: #Error when the Subform has no records
Dirk Goldgar - 27 May 2007 01:46 GMT
> This is excellent, can you tell me where should i put this code, on
> the main or subform, can I use it "On Load" of subform or main form?
>
>> http://www.mvps.org/access/forms/frm0022.htm
>> Forms: #Error when the Subform has no records

Paste the function code in a standard module.  Then set the
controlsource of your MainCount text box to this:

   =nnz([YourSubformName]![SubCount]

where "YourSubformName" is the name of the subform control (on the main
form) that displays the subform, and "SubCount" is the name of the text
box on the subform whose data you want to show.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.