Newbie: How to show text after user entered a number? (1 Viewer)

D

deegee

Guest
Hi everyone,

I'm new to the forums and new to Access so hi to y'all.

I am trying to create a tournament database with access. Excel will be not enough because I have about 600 people to enter the database and sort them by the sport they chose (since there are 16 to choose from), their age etc. So be assured that there are more questions from me coming ;)

Alright here's the first one. For easier and faster entering the sports I gave everything a number so let's say Inlinehockey is 1, Skateboarding is 3 and Baseball for example is 12. So what I have now is 600 applications with 3 numbers on them. So what I want now is to enter all those applications into the computer, but only the numbers.


So how to I show the names of the sports instead of the numbers in the report and let's say as a text right under the entered numbers in the Form?


I hope I do get some replies form you guys!

deegee
 

GumbyD

Accessosaurus
Local time
Today, 20:25
Joined
Aug 21, 2003
Messages
283
Deegee -

You are going to need to enter the sport names somewhere. There is no way to have them magically appear on a form if they are not stored in a table, referenced in code, or put into a property somewhere. Usually data like yours in handled in a code table where you associated a code (your numeric value) to a description of what the code means in a code table. Your code table might look as follows:

SportCode (Number, Long)
SportDescription (Text)

With data like
1 InLine Hockey
12 Baseball
Etc.

Good Luck!

GumbyD
 
D

deegee

Guest
Well I didn't want any magic to happen, just an explanation how to do it ;)

I think I can try working with what you suggested, it will be a blast finding out how to deal with it...

Thank you

deegee
 
D

deegee

Guest
Alright I tried some stuff but can't seem to get what I want. It's just too hard of a change for me using those buttons instead of "if-when-loops".

Ok Please someone help me out with sample code or a more detailed explanation, i'll give you what I want to do now:

Enter a number (let's take 3) into a textfield.
In the form there should appear "Baseball" right away after entering the number.
In the result I don't need the number anymore, just the "Baseball" since the number is just for faster entering (as already stated).

What I tried so far is to have a lookup table with all the numbers and the related descriptions for them, but I just don't know how to fit the main-forms and reports together with that lookup table.
 

GumbyD

Accessosaurus
Local time
Today, 20:25
Joined
Aug 21, 2003
Messages
283
Ok - This may not be exactly what you want - but you can alter it if you want to. You will need to create a query with your main table and the code table in it. The join from the main table to the code table should be an outer join pointing toward the code table. Create the form based on this query and make a combo box based on your code table - I like to display the code and desc in the drop down box (see the picture). Then add the desc field but change the locked property to yes and change the background color so that no one will try to change the data in there. Take a look at the attached image for a better expaination - a picture is worth 1000 words!

GumbyD
 

Attachments

  • sportcombo.zip
    71.6 KB · Views: 102

Users who are viewing this thread

Top Bottom