473,756 Members | 7,293 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Visible data with If/Then

jpr
Hello,
I have a form with twa txtboxes named mytxt and txtresult.

The txtresult gets its data from a module (GetInterval).

I have written this statement:

If IsNull (Me.mytxt) then
Me.txtresult) = Null

I get an error as if that control cannot contain null values.

I have done the same with another sample, simply changing the record
source of my txtresult to a field of my table and works?

can anyone see the problem?

I have also tried in with this code but still nothing:

If Len(Trim$(Me!US ER & vbNullString)) = 0 Then

Thanks.

Jun 14 '06 #1
3 1694
How does txtResult get its data from the module? What is the Control Source
of txtResult? If txtResult is bound to a field, is the field defined in the
table as Nulls not allowed (i.e. Required = Yes)? Where is the module
located, is it in the form that has these two textboxes? What is the error
that you get?

There are two typos in the example you gave (a space after IsNull and an
extra ")"), it should be:

If IsNull(Me.mytxt ) Then
Me.txtresult = Null
'other lines
End If

--
Wayne Morgan
MS Access MVP
"jpr" <jp***@tin.it > wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
Hello,
I have a form with twa txtboxes named mytxt and txtresult.

The txtresult gets its data from a module (GetInterval).

I have written this statement:

If IsNull (Me.mytxt) then
Me.txtresult) = Null

I get an error as if that control cannot contain null values.

I have done the same with another sample, simply changing the record
source of my txtresult to a field of my table and works?

can anyone see the problem?

I have also tried in with this code but still nothing:

If Len(Trim$(Me!US ER & vbNullString)) = 0 Then

Thanks.

Jun 14 '06 #2
jpr
Hello,
well, the record source of my control is not based on a field of a
table but on a code which recall a module.
What I need is simple something that says:

If txtresult has no data, then do not show the value in txtresult. See
the problem I am having is that since there is a date function code
that reads in the txtcontrol it will always show up even if there is no
data.
Basically my txtcontrol sums four other date controls. If these have
data then it txtresult should be visible if not it should not be
visible.

Thanks.
Wayne Morgan wrote:
How does txtResult get its data from the module? What is the Control Source
of txtResult? If txtResult is bound to a field, is the field defined in the
table as Nulls not allowed (i.e. Required = Yes)? Where is the module
located, is it in the form that has these two textboxes? What is the error
that you get?

There are two typos in the example you gave (a space after IsNull and an
extra ")"), it should be:

If IsNull(Me.mytxt ) Then
Me.txtresult = Null
'other lines
End If

--
Wayne Morgan
MS Access MVP
"jpr" <jp***@tin.it > wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
Hello,
I have a form with twa txtboxes named mytxt and txtresult.

The txtresult gets its data from a module (GetInterval).

I have written this statement:

If IsNull (Me.mytxt) then
Me.txtresult) = Null

I get an error as if that control cannot contain null values.

I have done the same with another sample, simply changing the record
source of my txtresult to a field of my table and works?

can anyone see the problem?

I have also tried in with this code but still nothing:

If Len(Trim$(Me!US ER & vbNullString)) = 0 Then

Thanks.


Jun 14 '06 #3
It would help if you would include in your message what you already have
that you want modified.

Possible Control Source:

IIf(IsNull([txtResult]), "", Your Equation)

--
Wayne Morgan
MS Access MVP
"jpr" <jp***@tin.it > wrote in message
news:11******** *************@y 41g2000cwy.goog legroups.com...
Hello,
well, the record source of my control is not based on a field of a
table but on a code which recall a module.
What I need is simple something that says:

If txtresult has no data, then do not show the value in txtresult. See
the problem I am having is that since there is a date function code
that reads in the txtcontrol it will always show up even if there is no
data.
Basically my txtcontrol sums four other date controls. If these have
data then it txtresult should be visible if not it should not be
visible.

Jun 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3190
by: tshad | last post by:
I have a datagrid that I want to add a new column to. This column will only be visible under certain conditions. So I want to set the column visible=false. Then when the right condition happens to change it to visible=true. You can't do that with a bound column (no ID), but you can create a templatecolumn with a label. To make these visible, I am going through each datagriditem and making them visible after I have bound the data to...
1
2003
by: tony | last post by:
Hello!! I have an application that consist of several windows forms. Lets call these A,B and C for simplicity. I have one main meny where the user can choose window form A or B or C. When a user bring up a window for the first time I create an instance otherwise I just set visible = true. When a user brings up a window form for example B and the user click on the
8
7734
by: gerry | last post by:
The PagerSettings.Visible property is not being handled properly by the GridView control. The value assigned to this property is not applied until after a postback. Simplest test : .aspx containing a single gridview - enable paging and give enough data to page. add checkbox with auto postback enable add button with auto postback enable in the GridView1_PreRender method add the following : GridView1.HeaderRow.Enabled =
5
3942
by: =?Utf-8?B?VGVycnk=?= | last post by:
Hi, I have a couple of labels on a form and their visible property is bound to boolean properties on a custom object. When I first load the form, all works as it should. This form is 'tied' together with a search form, and the user can go back and forth. When the user hits ok, the form is hidden and the search form is shown and visa-versa. The problem is that when the form is hidden when the labels visible property is False, and then...
0
9303
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9894
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9679
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8542
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7078
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6390
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4955
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2508
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.