Data Input and Post

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

Guest

I have a form for data entry. Currently the use enters y for yes and n for
no. I was wondering if there is a way to allow the user to enter y and n but
have it post to the table as a 1 or 2. I can't seem to figure out how to do
this. I would appreciate any help.
 
You can use Option Group. If you use the wizard it is strait forward.

There is a toolbar button for option group if you go in form design. Cannot
miss it.

Yanick
 
Hi Diane

two possible ways I can think of:

A. Make the control (text box? - assume it's called TheTextBox) where
the user enters Y or N unbound - i.e. set its Controlsource to blank.
Then in the form's Before_Update event procedure, convert the text box
value and save it to the field the text box used to be bound to (let's
call it Field1):

If Me.THeTxtBox="Y" Then
Me!Field1=1
ElseIf Me.TheTextBox="N" Then
Me!Field1=2
Else
'Allow a blank? If not, put a MsgBOx here and set Cancel to True to
cancel the save
End If

B. Use a multi-column combo box. Make it have 2 columns, make column
1 the bound column, and set the Rowsource to
1;Y;2;N, so that you end up with a list like this:

1 Y
2 N

If you set the ColumnWidths so that column 1 has a width of zero (i.e.
set it to 0;[some width]), the user will be able to type Y or N in the
combo, but the combo's actual _value_ will be the hidden value in
column 1 - this will get saved to the table.

cheers


Seb
 
Thank you so much for the quick response. I appreciate your help and I am
going to try your suggestion.
 
Thank you so much for your quick reply. I appreciate your two suggestions
and will try both of them to see which one my data entry people like the best.
 
Back
Top