Keyword Integer

D

Dan

What is the keyword for integers? I want to say something
like:

If Me.hold = "Unlimited" Then
Hold_Time = "Unlimited
Else If Me.hold = Integer Then
Hold_Time = ...
Else MsgBox "Not a Valid Amount of hold time
End If

Also is the "Else If" correct code or is it different?

Thanks
 
D

Dan Artuso

Hi,
You can use IsNumeric for this
ElseIf IsNumeric(Me.hold) Then

Notice ElseIf (all one word)
 
M

Mike Painter

Dan said:
What is the keyword for integers? I want to say something
like:

If Me.hold = "Unlimited" Then
Hold_Time = "Unlimited
Else If Me.hold = Integer Then
Hold_Time = ...
Else MsgBox "Not a Valid Amount of hold time
End If

Also is the "Else If" correct code or is it different?

Thanks

If Me!hold = "Unlimited" Then
Hold_Time = "Unlimited
Else If isnumeric(Me!hold) Then
Hold_Time = ...
Else
MsgBox "Not a Valid Amount of hold time
End If

The problem you may face her is if you try to sort on these values. The
numbers will sort as text values E.G.

1
10
11
2
3
31
Unlimited
 

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