Subform's OnClick/LostFocus Event

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

Guest

I am unable to figure out how to disable some of my command buttons on the
main form when my subform looses focus. First, I use the following event to
enable some command buttons on the main form:

' Procedure that handles the click method of the subform
Private Sub Form_Click()
Dim frmTransfer As Form_frmTransfers
Set frmTransfer = Form_frmTransfers

frmTransfer.cmdEdit.Enabled = True
frmTransfer.cmdDelete.Enabled = True
End Sub

Then, I've tried the following method to enable the command buttons:

' Procedure that handles the lost focus method of the subform
Private Sub Form_LostFocus()
Dim frmTransfer As Form_frmTransfers
Set frmTransfer = Form_frmTransfers

If frmTransfer.cmdEdit.Enabled = True And _
frmTransfer.cmdDelete.Enabled = True Then

frmTransfer.cmdEdit.Enabled = False
frmTransfer.cmdDelete.Enabled = False
End If
End Sub

The command buttons' original enabled property is set to 'False'. I am
using Access 2000. Any help would be appreciated.
 
Back
Top