Disabling text boxes when selection made

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

Guest

Hello, I am desperately after your help.

I am trying to disable text boxes when a selection is made (via checkbox
created in Option Group on the toolbar) on a form, it is something like this.

⌠Full Payment
⌠Instalments

A) Text Fields: DatePaidFull, MethodFull, ReceiptNoFull, AmountFull
B) Text Fields: InstallDate1, Method1, ReceiptNo1, Amount1
C) Text Fields: InstallDate2, Method2, ReceiptNo2, Amount2

When 'Full Payment' is checked, I would like the text fields above (B & C)
to be disabled or greyed out so no information can be input unless they
change the option to Instalment and then the Text Fields (in A) would be
disabled etc.

The Event tab for the check box, only has certain choices available, unlike
text boxes etc. I can only select Code Builder with "Got & Lost Focus, Mouse
Up, Down & Move, Key Up, Down & Press)

I hope this helps explain what help I need.

Over to you guys and gals, any help would be extremely appreciated.
 
hi,
2 options.
1. set the visibility property to false.
me.textbox1.visible = false
this will make the text box "disappear"
this code would be put in the checkbox
2. set the enabled property to false.
me.textbox1.enabled = false
this will cause the text box to "gray out" and not allow
input.
but if you use one of the options above you will have to
have code to turn the text box back on
me.textbox1.enabled = true.
here is some code i use to run a history by date.
if check box date is checked then the other check boxes
are unchecked and the text files of employee id and name
are unenabled while the date text box is enabled.
Private Sub chkDate_Click()

If Me.chkDate = True Then
Me.chkOld = False
Me.ChkNegBal = False
Me.chkCurrent = False
Me.txtDateInput.Enabled = True
Me.txtEmpID = Null
Me.txtEmpName = Null
Me.txtEmpID.Enabled = False
Me.txtEmpName.Enabled = False
Me.txtDateInput.SetFocus
End If

End Sub
Regards
Frank
 
Back
Top