Dim dr As OleDb.OleDbDataReader = GetData(qry)
If dr.HasRows = True Then
Do While dr.Read
TextBox32.Text = dr.Item("total")
If Val(TextBox32.Text) > 800 Then
TextBox37.Text = Val(TextBox32.Text) - 800
Else
TextBox37.Text = 0
End If
TextBox38.Text = Val(TextBox36.Text) + Val(TextBox37.Text)
TextBox31.Text = (Val(TextBox33.Text) + Val(TextBox32.Text)) * Val(TextBox34.Text)
Loop
Else
If MsgBox("Fuel allowance not defined for the current month of " & MonthName(currentdate.Month, False) & vbCrLf & _
"Do you want to define it?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Project Payroll") = MsgBoxResult.Yes Then
TextBox27.Focus()
Else
MsgBox("Cannot define allowance without defining fuel allowance", MsgBoxStyle.Critical, "Project Payroll")
Exit Sub
End If
End If
Hi guys,
I have a code placed in a textbox got focus event.what it does is when it gets a focus it finds a value from a table and assigns it to the textbox.But if ther's no value it tells the user to define it and puts the focus on another control if the response is yes otherwise telling the user it can't proceed.
What i'm getting is,if there's no value and the response is yes it can't put the focus to that control and just loops the message.Any idea to break the loop if the response is yes.