B
Bruce
I have the following in the After Update event of a text
box:
If MsgBox("Completed?", vbYesNo) = vbYes Then
Me.txtNext.SetFocus
Else: {perform an action}
End If
Me.txtNext.SetFocus is, in effect, closing the message box
without taking any action. I would prefer to just close
the message box through code, but Me.txtNext.SetFocus is
what would happen in that case anyhow.
I would like for the message box to appear only if it is a
new record, not when editing an existing record (uncommon,
but it does need to happen sometimes). If it simplifies
the code, I have a text box that reads "New Record" only
when that is the case (it shows "Record X of Y"
otherwise). So what I need is maybe something like:
If Me.txtXofY = "New Record" Then
{run the code above}
As a general question, is there VBA code for "Do Nothing"?
box:
If MsgBox("Completed?", vbYesNo) = vbYes Then
Me.txtNext.SetFocus
Else: {perform an action}
End If
Me.txtNext.SetFocus is, in effect, closing the message box
without taking any action. I would prefer to just close
the message box through code, but Me.txtNext.SetFocus is
what would happen in that case anyhow.
I would like for the message box to appear only if it is a
new record, not when editing an existing record (uncommon,
but it does need to happen sometimes). If it simplifies
the code, I have a text box that reads "New Record" only
when that is the case (it shows "Record X of Y"
otherwise). So what I need is maybe something like:
If Me.txtXofY = "New Record" Then
{run the code above}
As a general question, is there VBA code for "Do Nothing"?