scantor145
11-25-2003, 05:57 AM
Below is a portion of a macro that is to check to see if a value was entered into a text box called txtCalConc. If no value was entered then I have a warning message screen pop up. I then reset the focus on the text box.
Problem: The message appears with no trouble, however, when I the select OK button, although I saw that focus was set on the textbox, the form disappeared immediately and the macro proceeded as normal.
What statement do I need after
frmOptions.txtCalConc.SetFocus
to go back to the form and enter an appropriate value?
Private Sub cmdContinue_Click()
Dim Press As Single
If frmOptions.chkCal = True And frmOptions.txtCalConc = "" Then
Press = MsgBox("Enter a concentration for the Calibrator", vbCritical)
frmOptions.txtCalConc.SetFocus
End If
frmOptions.Hide
Call NewWork
End Sub
Problem: The message appears with no trouble, however, when I the select OK button, although I saw that focus was set on the textbox, the form disappeared immediately and the macro proceeded as normal.
What statement do I need after
frmOptions.txtCalConc.SetFocus
to go back to the form and enter an appropriate value?
Private Sub cmdContinue_Click()
Dim Press As Single
If frmOptions.chkCal = True And frmOptions.txtCalConc = "" Then
Press = MsgBox("Enter a concentration for the Calibrator", vbCritical)
frmOptions.txtCalConc.SetFocus
End If
frmOptions.Hide
Call NewWork
End Sub