I use microsoft access 2007. I have created a table and i want to fill it through a form. So, i went to new form tab. I drag 3 fields of the table in the form. The names of the fields are "Price", "Tax" and "Priceless".
I have defined from the table that the field "Price" will be a combo box and i have entered 3 options:
<100
<200
<300
At the form, all i want is that only when i choose the option <300, only then i can fill in the other two fields. Otherwise i cannot fiil in these fields because they will be disabled.
So, while i am in the form, i choose the combo box field, right click, properties and a right menu appears. At the right menu, i choose the 3rd option and at the tab, "at change", i push a button with 3 dots. A window appear and i choose the 3rd option, that says something about adding code. I think that opens the visual basic platform and i get this:
Private Sub Transfer_Change()
End Sub
At this point, i write between the first and the last line this:
If Price.ListIndex > -1 And Price.Text = "<300" Then
Tax.Enabled = True
Priceless.Enabled = True
Else
Tax.Enabled = False
Priceless.Enabled = False
End If
But when i open the form, i can fill in the "Tax" and "Priceless" fields at all occasions, whether the option of "Price" field is <100 or <200 or <300.