Text Box with ability to enter the user friendly 'looked up' value

  • Thread starter Thread starter Green Biro
  • Start date Start date
G

Green Biro

I want a user to enter marks for a register "/" = Present, "A" = Auth Absent
and "U" = Unauth Absence on a form

If I use a combo, I can display - and allow the user to enter - the friendly
codes.

Can I somehow allow them to enter the user friendly values into a textbox
such that it would update the table. When I change my control to a textbox,
it's only possible to enter the key (0,1 or 2) that the table is expecting.

Thans in advance for any insights

GB
 
Remember the table is going to display data that's entered, you can use the
AfterUpdate event to change the entry, but you cannot put text in a numeric
field. A combo or list box is the proper control for entering and displaying
data which is from a different field than what is being stored.
 
I felt that it was quite important for the user to be able to enter the
'friendly' into a simple text box rather than a listbox.

I accomplished this by having two fields in the table I was querying, one
with the key value and one with the friendly value. Although I have the key
value field in a textbox in my form, it is hidden from the user. I use the
DLookup function in the "After_Update" event of the friendly name field to
write the correct value into the key value field. I also use the Dlookup
function in the validation property of the friendly field textbox to ensure
that a valid entry has been made.

All seems to be working so far....

GB
 
You could make it faster and use fewer resources by using a function with a
Select Case statement to write the choice to the second field in the
AfterUpdate event. Also rather than using 2 fields to store a single value
of data, you might use the Current function of the form to fill an unbound
textbox. This will only work for single form view though.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Back
Top