A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to make a Form Field return numeric value



 
 
Thread Tools Display Modes
  #1  
Old December 2nd, 2004, 03:19 PM
Todd
external usenet poster
 
Posts: n/a
Default How to make a Form Field return numeric value

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.
  #2  
Old December 2nd, 2004, 05:39 PM
Steve Huff
external usenet poster
 
Posts: n/a
Default

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

"Todd" wrote:

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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to clear controls of Filter form Jan Il Using Forms 2 November 28th, 2004 02:04 PM
Cursor Positioning Colin Hammond General Discussion 3 November 2nd, 2004 08:42 PM
auto entry into second table after update Tony New Users 13 July 9th, 2004 10:42 PM
synchronizing form and list box Deb Smith Using Forms 8 June 21st, 2004 08:15 PM
NUMBERING the pages Bob New Users 7 June 14th, 2004 12:20 AM


All times are GMT +1. The time now is 05:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.