Need help with auto input

bacardi451

Registered User.
Local time
Today, 15:46
Joined
Mar 20, 2002
Messages
33
I have a form that has to fields.
One is a BPMC score field and anotherone is Bpmc qualified field.
The score field is numeric max is 3 numbers
the qualified field has a dropdown box that has menu with three choices.
example: Marksmanship
Sharpshooter
Expert
What i would like to do is when I input the number in the score box access automatically inputs the qualified filed
If I input in the bpmc field lets say 118 the Bpmc qualified field should automaticaly come up as Marksmanship.
The number score range for the qualified field will determine what field will go there
the numbers are what is needed to get the following
score qualified
114 - 128 Marksmanship
129 - 143 Sharpshooter
144 - 150 Expert

if I input 115 access automaticaly assigns the field Marksmanship
This a database for the coast guard.

Thanks in advance
 
In the On Change event of your text box, you can do something like this:

Select Case txtMyTextBox

Case < 114
exit sub
Case = < 128
cmbMyComboBox = "Marksmanship"
Case = < 143
cmbMyComboBox = "Sharpshooter"
Case = > 144
cmbMyComboBox = "Expert"
End Select
 
Place the following in the AfterUpdate Event of the textbox:

if me.textboxname.text > 143 then
me.combobox = "Expert"
Else
if me.textboxname.text > 128 then
me.combobox = "Sharpshooter"
Else
if me.textboxname.text > 113 then
me.combobox = "Marksmanship"
Else
End if
End if
End if

Crude, but it should work.
 
But if you use mine, it will update immediately upon entering a valid number and you don't have to exit the text box for the combobox to update.

And it's cleaner code.
 

Users who are viewing this thread

Back
Top Bottom