Negative Number Help Needed ?

D

Dave Elliott

777 is a negative number for the criteria needed
That is it is lower than zero, i.e. ($2.00)
777 is a TextBox and on the main form.
So, if the value of the textbox 777 is less than zero the run code


If 777 < 0 Then
CI30.Visible = True
End If
 
D

Dirk Goldgar

Dave Elliott said:
777 is a negative number for the criteria needed
That is it is lower than zero, i.e. ($2.00)
777 is a TextBox and on the main form.
So, if the value of the textbox 777 is less than zero the run code


If 777 < 0 Then
CI30.Visible = True
End If

Are you saying that "777" is the *name* of a text box on the form? Then
you'd better make that clear to Access:

If Me![777] < 0 Then
CI30.Visible = True
End If
 
D

Dave Elliott

Yes 777 is the name of my textbox, however the code still does not work ?
Is it that the number in 777 is a negative amount? which is what I am
checking for?
In other words, the customer has overpaid!

Dirk Goldgar said:
Dave Elliott said:
777 is a negative number for the criteria needed
That is it is lower than zero, i.e. ($2.00)
777 is a TextBox and on the main form.
So, if the value of the textbox 777 is less than zero the run code


If 777 < 0 Then
CI30.Visible = True
End If

Are you saying that "777" is the *name* of a text box on the form? Then
you'd better make that clear to Access:

If Me![777] < 0 Then
CI30.Visible = True
End If

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
D

Dirk Goldgar

Dave Elliott said:
Yes 777 is the name of my textbox, however the code still does not
work ? Is it that the number in 777 is a negative amount? which is
what I am checking for?
In other words, the customer has overpaid!

Dirk Goldgar said:
Dave Elliott said:
777 is a negative number for the criteria needed
That is it is lower than zero, i.e. ($2.00)
777 is a TextBox and on the main form.
So, if the value of the textbox 777 is less than zero the run code


If 777 < 0 Then
CI30.Visible = True
End If

Are you saying that "777" is the *name* of a text box on the form?
Then you'd better make that clear to Access:

If Me![777] < 0 Then
CI30.Visible = True
End If

In what way does the code "not work"? Do you get an error message, or
does nothing happen, or what?

You mentioned that the text box [777] is on the "main form". Is this
code running on a subform of that main form If so, you need to tell
Access that [777] is not on this form, but on its parent form:

If Me.Parent![777] < 0 Then
CI30.Visible = True
End If
 
J

John Vinson

Yes 777 is the name of my textbox, however the code still does not work ?
Is it that the number in 777 is a negative amount? which is what I am
checking for?

Change the name of the textbox.

777 *IS A NUMBER*.

Access is comparing the value in the table with the numeric value 777
(which is not a negative number). You *might* be able to get around
this by enclosing the control name in brackets, but it's simply bad
design.

If you want to *see* 777 on the form use a Label or set the Caption
property of the control - but don't use 777 as the Name of the
control, use A777 or some other alphanumeric or alphabetic name
instead.

John W. Vinson[MVP]
 
D

Dave Elliott

The TextBox does not show up, and yes krap is the name of a textbox on the
main form.

If Me.krap < 0 Then
Me.CI30.Visible = True
End If



Dirk Goldgar said:
Dave Elliott said:
Yes 777 is the name of my textbox, however the code still does not
work ? Is it that the number in 777 is a negative amount? which is
what I am checking for?
In other words, the customer has overpaid!

Dirk Goldgar said:
777 is a negative number for the criteria needed
That is it is lower than zero, i.e. ($2.00)
777 is a TextBox and on the main form.
So, if the value of the textbox 777 is less than zero the run code


If 777 < 0 Then
CI30.Visible = True
End If

Are you saying that "777" is the *name* of a text box on the form?
Then you'd better make that clear to Access:

If Me![777] < 0 Then
CI30.Visible = True
End If

In what way does the code "not work"? Do you get an error message, or
does nothing happen, or what?

You mentioned that the text box [777] is on the "main form". Is this
code running on a subform of that main form If so, you need to tell
Access that [777] is not on this form, but on its parent form:

If Me.Parent![777] < 0 Then
CI30.Visible = True
End If

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
D

Dave Elliott

Thanks for heads up on the naming convetion thing, however I still cant get
it to work,
The TextBox does not show up, and yes krap is the name of a textbox on the
main form.

If Me.krap < 0 Then
Me.CI30.Visible = True
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top