How to make a Form Field return numeric value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a field (Field A) that has a list box with values such as
apple, orange, and bannana. In field B I would like it to display
automatically a 1 if apple is selected in Field A, a 2 if orange is selected
and so on. How can I do this? Thanks for any help.
 
There are several ways to accomplish this, here is one:

Put code like this in the On Click event of the list box:

Select Case cboFieldA
Case "Apple"
txtFieldB = 1
Case "Orange"
txtFieldB = 2
Case "Bannana"
txtFieldB = 3
Case Else
txtFieldB = ""
End Select
 

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