calling a form

  • Thread starter Thread starter Maracay
  • Start date Start date
M

Maracay

HI guys

I have a form call frmMasterData in this form I have a option group called
FramePrePostSort and a command button to execute another form frmImpData.

I shouldn’t be able to execute the form frmImpData if some of the options of
FramePrePostSort are not selected, how can I do that?

Thanks
 
Just a question or two:

You did not indicate if the frame control is bound to a data field or not.
If the frame is bound then the selected option will be selected when the form
loads, but if your frame control is not bound, then you should set a default
value for your group frame control. If you set the default value to Null the
option buttons inside the control will appear greyed and neither selected or
unselected when the form loads. If you set the default value of the frame
control to zero then all of the options inside the frame will be unselected
when the form opens and your user will have to make a selection.

Linq's code would be fine if the default value of your control is Null.
However, if the default value of your control is set to zero then you would
just set the command button to disabled and then in the After Update event of
your frame control, use this code:

if me.FramePrePostSort = 0 Then
cmdCallfrmImpData.Enabled = False
Else
cmdCallfrmImpData.Enabled = True
End If
 
Back
Top