thank beachbum, Sorry i made a mistake on Copy and paste on this forum It should be this way that cause me error
VB Code:
'This is in the Module. Public Sub EMptyWS(FormName As Form, Cancel As Boolean) If Len(FormName.txtSumInsured.Text) = 0 Then MsgBox "Please enter a Sum Insured amount first", vbExclamation, "Wind Screen" Else FormName.txtWs.Text = CDbl(FormName.txtperWs.Text) * CDbl(FormName.txtSumInsured.Text) / 100 Cancel = True 'this is to setfocus on mskNCD textbox until 'Len(FormName.txtSumInsured.Text) > 0 'But i would like to set focus txtSumInsured until the condition is Len(FormName.txtSumInsured.Text) > 0. 'How? if i choose to set txtSumInsured.Setfocus the cursor would not be there But another textbox 'where i click on another textbox End If End Sub 'This is in the Form Private Sub mskNCD_Validate(Cancel As Boolean) EMptyWs FrmPoliCreate ' Arugement Not Optional ??? End Sub




Reply With Quote