Revise code

G

Guest

I have this code
Private Sub Form_Open(Cancel As Integer)
Dim strMsg As String
If (Nz(Me.[TA Number], "") = "") Then
strMsg = "No Travels to Approve."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data")
= vbRetry Then
Me.[TA Number].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.Name, acSaveNo
Exit Sub
End If
End If
DoCmd.OpenForm "Appoved"
End Sub

Instead of it saying retry cancel. Can I have it say go to approval or okay?

This will make more sense to the person operating it.
Thanks
Chey
 
P

Pieter Wijnen

no, but you can use vbYesNo & test for vbYes instead
Also revise the text in accordance
it should also suffice to use:
If IsNull(Me.[TA Number].Value Then
instead of the Nz in this case

Pieter
And your question was more understandable this time <g>
 
P

Pieter Wijnen

no, but you can use vbYesNo & test for vbYes instead
Also revise the text in accordance
it should also suffice to use:
If IsNull(Me.[TA Number].Value Then
instead of the Nz in this case

Pieter
And your question was more understandable this time <g>

Chey said:
I have this code
Private Sub Form_Open(Cancel As Integer)
Dim strMsg As String
If (Nz(Me.[TA Number], "") = "") Then
strMsg = "No Travels to Approve."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data")
= vbRetry Then
Me.[TA Number].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.Name, acSaveNo
Exit Sub
End If
End If
DoCmd.OpenForm "Appoved"
End Sub

Instead of it saying retry cancel. Can I have it say go to approval or
okay?

This will make more sense to the person operating it.
Thanks
Chey



--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top