Data Input Help

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

Guest

I have a form that currently uses y for yes and n for no. I need to still
allow the form user to use y and n but I want the data in the table to be
recorded as a 1 for yes and a 2 for no. I can't find any information on if I
can do this or if I can how. Help!!
 
You will need an additional hidden control. The new control should be the
one bound to your table field. Unbind the current control as it will be for
data entry only.
Let's say the new box that has 1 or 2 is named txtReal and the one with the
y or n is txtFake.

In the Current event of your form:

Me.txtFake = IIf(Me.txtReal = 1,"y","n")

In the Before Update event of your form:

Me.txtReal = IIf(Me.txtFake = "y", 1, 2)

Also, you will want to do whatever you need to ensure ony Y or N is entered.
 
I recommend that you see up a 'combo box' (look in Access Help for details).
The combo box will have 2 columns, the first will be the bound column and
will hold the 0 or 1 from the table; set the length to zero so it does not
display. The second column will have the corresponding N or Y for display to
the user.
Your value list property will contain 0,N;1,Y
Your column widths property will be 0",0.5"

-Dorian
 
Back
Top