473,386 Members | 1,693 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,386 software developers and data experts.

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!USER & vbNullString)) = 0 Then

Thanks.

Jun 14 '06 #1
3 1681
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.googlegr oups.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!USER & 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.googlegr oups.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!USER & 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*********************@y41g2000cwy.googlegro ups.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
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...
1
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...
8
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...
5
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'...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
0
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...

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.