InputBox

  • Thread starter Thread starter Tee See
  • Start date Start date
T

Tee See

If the InputBox function returns a string ..... is there an "InputBox" type
function which can accept an integer?
What I'm really trying to accomplish is for a "BOX" to show up when my
database loads in order to input the current days Canada/US exchange rate,
place it in a table called "ExchRate" to be further utilized in calculations
in queries. How best to achieve?

Thanks
 
well, you could go ahead and use an InputBox, and then convert the return
value to an integer using the CInt() function.

hth
 
Tina,
Since the exchange rate probably contains decimals, I would probably convert
the string value with CDbl (not CInt) or CCur or wrap it with the Val
function. I would also trap for a zero length string.

On the other hand, I would open a form bound to a query on the ExchRate
table and directly enter the data there. That way you have a lot more
control over the value that is entered in terms of checking it for validity.
 
well, Tee's post asked about an integer, John, so my suggestion responded to
that. as for the data entry, i'd use a form too, personally, but an InputBox
would work if you're prepared to do the coding to support it. i figured i'd
answer the specific questions that came up, rather than laying out a whole
theoretical course of action to cover it all.

hth
 
Yes, you are right that Tee asked for integer. Perhaps, I over-analyzed it.
I should have addressed the reply to Tee with a preface something like.

In addition to Tina's response, you might consider ...

Like you, I often answer the exact question. Sometimes that works well and
sometimes that means 10 more posts in the thread when you get the "It
doesn't work" reply.

Keep up the good work.
 
tina said:
well, you could go ahead and use an InputBox, and then convert the return
value to an integer using the CInt() function.

Or use the Val function which will use the entry if it's integer or not.

Tom Lake
 

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