Syntax To Insert A Number Into One TrxtBox If A Different TextBox Has A Date That Is => 1/1/98

  • Thread starter Thread starter Minitman
  • Start date Start date
M

Minitman

Greetings,

In an Exit event I need to see if the date value in TextBox1 is =>
9/15/1998. If yes, then the value in TextBox 7 needs to be .0825. If
not, the value in TextBox7 needs to be.08.
I tried this:

If TextBox1.Value => "9/15/1998" Then
TextBox7.Value = "8.25%"
Else:
TextBox7.Value = "8%"
End If

But it only returns .0825 in TextBos7, no matter what the date is in
TextBox1.

What am I doing wrong?

Can anyone help me?

TIA

-Minitman
 
The code works correctly with me. maybe instead of => you should put >
 
Hey Minitman,

try this:

Dim date1 As Date

date1 = TextBox1.Value
If date1 >= "9/15/1998" Then
TextBox2.Value = "8.25%"
Else
TextBox2.Value = "8%"
End If

-Erik
 
Hey Erik,

That was the answer - I did not have TextBox1 Dimmed as a date. Thank
you, this now works.

-Minitman
 
Hey Mangesh,

Thanks for the reply. I do appreciate it.

Changing the order (=> to >=) was part of the solution. The other
part was dimming the date as date.

I forgot to mention that I am running Excel 2003 on a Win 2k box.
This may also have been a factor.

-Minitman
 

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

Back
Top