Yes No

G

Guest

I have this code for a command button
If (IsNull(Me.[TA Created By]) Or Me.[TA Created By] = "") Then
MsgBox "Please Choose POV GIVEN TO-Only Continue if you are ready to
submit POV."
Me.[TA Created By].SetFocus
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another Test
Mileage]![ID]"

DoCmd.Close
When the error mesg. pops up I would like a yes no box. That says yes
continue or no Close. So if it is yes return to form, if no then close.
Can this be done?
Thanks for your help.
Cheyenne
 
D

Douglas J Steele

You need to use the MsgBox function, rather than the MsgBox action:

If MsgBox("Please Choose POV GIVEN TO-" & _
"Only Continue if you are ready to submit POV.", _
vbYesNo) = vbYes Then

' Put what code you want if they answer Yes here

Else

' Put what code you want if they answer No here

End If
 
W

Wayne Morgan

Yes, it can be done by using the MsgBox function instead of the MsgBox
statement (note the parentheses in the new statement). Also, the first
If...Then line can be shortened slightly.

Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
'variable used to make MsgBox function shorter and easier to read
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready to
submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
'I'm just guessing on what you might want here
Me.Undo
DoCmd.Close acForm, Me.Name, acSaveNo
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another Test
Mileage]![ID]"

'DoCmd.Close
'I recommend that you specify what to close
'otherwise, you'll close the item with the focus
DoCmd.Close acForm, Me.Name, acSaveNo
 
G

Guest

Well thanks for the response
This is the code I have now
Private Sub Command33_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If

It says compile error and hilights the first row.
Can you help me in figuring out where I went wrong.
Thanks

Wayne Morgan said:
Yes, it can be done by using the MsgBox function instead of the MsgBox
statement (note the parentheses in the new statement). Also, the first
If...Then line can be shortened slightly.

Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
'variable used to make MsgBox function shorter and easier to read
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready to
submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
'I'm just guessing on what you might want here
Me.Undo
DoCmd.Close acForm, Me.Name, acSaveNo
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another Test
Mileage]![ID]"

'DoCmd.Close
'I recommend that you specify what to close
'otherwise, you'll close the item with the focus
DoCmd.Close acForm, Me.Name, acSaveNo

--
Wayne Morgan
MS Access MVP


Chey said:
I have this code for a command button
If (IsNull(Me.[TA Created By]) Or Me.[TA Created By] = "") Then
MsgBox "Please Choose POV GIVEN TO-Only Continue if you are ready to
submit POV."
Me.[TA Created By].SetFocus
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another
Test
Mileage]![ID]"

DoCmd.Close
When the error mesg. pops up I would like a yes no box. That says yes
continue or no Close. So if it is yes return to form, if no then close.
Can this be done?
Thanks for your help.
Cheyenne
 
W

Wayne Morgan

It highlights the first row, "Dim strMsg As String"? If so, check this link
to repair your References.

http://www.allenbrowne.com/ser-38.html

--
Wayne Morgan
MS Access MVP


Chey said:
Well thanks for the response
This is the code I have now
Private Sub Command33_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If

It says compile error and hilights the first row.
Can you help me in figuring out where I went wrong.
Thanks

Wayne Morgan said:
Yes, it can be done by using the MsgBox function instead of the MsgBox
statement (note the parentheses in the new statement). Also, the first
If...Then line can be shortened slightly.

Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
'variable used to make MsgBox function shorter and easier to read
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to
submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
'I'm just guessing on what you might want here
Me.Undo
DoCmd.Close acForm, Me.Name, acSaveNo
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another
Test
Mileage]![ID]"

'DoCmd.Close
'I recommend that you specify what to close
'otherwise, you'll close the item with the focus
DoCmd.Close acForm, Me.Name, acSaveNo

--
Wayne Morgan
MS Access MVP


Chey said:
I have this code for a command button
If (IsNull(Me.[TA Created By]) Or Me.[TA Created By] = "") Then
MsgBox "Please Choose POV GIVEN TO-Only Continue if you are ready to
submit POV."
Me.[TA Created By].SetFocus
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another
Test
Mileage]![ID]"

DoCmd.Close
When the error mesg. pops up I would like a yes no box. That says yes
continue or no Close. So if it is yes return to form, if no then
close.
Can this be done?
Thanks for your help.
Cheyenne
 
G

Guest

no it highlights this
Private Sub Command33_Click()

I am looking into the Libraries though.
Should I just do a new command button and paste the code there? or do I have
something mistyped?

Wayne Morgan said:
It highlights the first row, "Dim strMsg As String"? If so, check this link
to repair your References.

http://www.allenbrowne.com/ser-38.html

--
Wayne Morgan
MS Access MVP


Chey said:
Well thanks for the response
This is the code I have now
Private Sub Command33_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If

It says compile error and hilights the first row.
Can you help me in figuring out where I went wrong.
Thanks

Wayne Morgan said:
Yes, it can be done by using the MsgBox function instead of the MsgBox
statement (note the parentheses in the new statement). Also, the first
If...Then line can be shortened slightly.

Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
'variable used to make MsgBox function shorter and easier to read
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to
submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
'I'm just guessing on what you might want here
Me.Undo
DoCmd.Close acForm, Me.Name, acSaveNo
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another
Test
Mileage]![ID]"

'DoCmd.Close
'I recommend that you specify what to close
'otherwise, you'll close the item with the focus
DoCmd.Close acForm, Me.Name, acSaveNo

--
Wayne Morgan
MS Access MVP


I have this code for a command button
If (IsNull(Me.[TA Created By]) Or Me.[TA Created By] = "") Then
MsgBox "Please Choose POV GIVEN TO-Only Continue if you are ready to
submit POV."
Me.[TA Created By].SetFocus
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another
Test
Mileage]![ID]"

DoCmd.Close
When the error mesg. pops up I would like a yes no box. That says yes
continue or no Close. So if it is yes return to form, if no then
close.
Can this be done?
Thanks for your help.
Cheyenne
 
G

Guest

I pasted the code to a new command button. Now it says compile error
Block if without end if
this is what I have
Private Sub Command156_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If

End Sub

Thanks again for all your help.

Wayne Morgan said:
It highlights the first row, "Dim strMsg As String"? If so, check this link
to repair your References.

http://www.allenbrowne.com/ser-38.html

--
Wayne Morgan
MS Access MVP


Chey said:
Well thanks for the response
This is the code I have now
Private Sub Command33_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If

It says compile error and hilights the first row.
Can you help me in figuring out where I went wrong.
Thanks

Wayne Morgan said:
Yes, it can be done by using the MsgBox function instead of the MsgBox
statement (note the parentheses in the new statement). Also, the first
If...Then line can be shortened slightly.

Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
'variable used to make MsgBox function shorter and easier to read
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to
submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
'I'm just guessing on what you might want here
Me.Undo
DoCmd.Close acForm, Me.Name, acSaveNo
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another
Test
Mileage]![ID]"

'DoCmd.Close
'I recommend that you specify what to close
'otherwise, you'll close the item with the focus
DoCmd.Close acForm, Me.Name, acSaveNo

--
Wayne Morgan
MS Access MVP


I have this code for a command button
If (IsNull(Me.[TA Created By]) Or Me.[TA Created By] = "") Then
MsgBox "Please Choose POV GIVEN TO-Only Continue if you are ready to
submit POV."
Me.[TA Created By].SetFocus
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another
Test
Mileage]![ID]"

DoCmd.Close
When the error mesg. pops up I would like a yes no box. That says yes
continue or no Close. So if it is yes return to form, if no then
close.
Can this be done?
Thanks for your help.
Cheyenne
 
M

Mike Brearley

You're missing an end if, just as the error states. You have two if
statements, and one end if. Try this:

Private Sub Command156_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data")
= vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If
End If
End Sub


Chey said:
I pasted the code to a new command button. Now it says compile error
Block if without end if
this is what I have
Private Sub Command156_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If

End Sub

Thanks again for all your help.

Wayne Morgan said:
It highlights the first row, "Dim strMsg As String"? If so, check this
link
to repair your References.

http://www.allenbrowne.com/ser-38.html

--
Wayne Morgan
MS Access MVP


Chey said:
Well thanks for the response
This is the code I have now
Private Sub Command33_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are
ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data")
=
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If

It says compile error and hilights the first row.
Can you help me in figuring out where I went wrong.
Thanks

:

Yes, it can be done by using the MsgBox function instead of the MsgBox
statement (note the parentheses in the new statement). Also, the first
If...Then line can be shortened slightly.

Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
'variable used to make MsgBox function shorter and easier to read
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are
ready
to
submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete
Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
'I'm just guessing on what you might want here
Me.Undo
DoCmd.Close acForm, Me.Name, acSaveNo
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another
Test
Mileage]![ID]"

'DoCmd.Close
'I recommend that you specify what to close
'otherwise, you'll close the item with the focus
DoCmd.Close acForm, Me.Name, acSaveNo

--
Wayne Morgan
MS Access MVP


I have this code for a command button
If (IsNull(Me.[TA Created By]) Or Me.[TA Created By] = "") Then
MsgBox "Please Choose POV GIVEN TO-Only Continue if you are ready
to
submit POV."
Me.[TA Created By].SetFocus
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, ,
"[ID]=[Forms]![Another
Test
Mileage]![ID]"

DoCmd.Close
When the error mesg. pops up I would like a yes no box. That says
yes
continue or no Close. So if it is yes return to form, if no then
close.
Can this be done?
Thanks for your help.
Cheyenne
 
G

Guest

Now did I do this part right?
DoCmd.Close acForm, Me.[Another Mileage Test], acSaveNo
My form name is Another Mileage Test.

Mike Brearley said:
You're missing an end if, just as the error states. You have two if
statements, and one end if. Try this:

Private Sub Command156_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data")
= vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If
End If
End Sub


Chey said:
I pasted the code to a new command button. Now it says compile error
Block if without end if
this is what I have
Private Sub Command156_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If

End Sub

Thanks again for all your help.

Wayne Morgan said:
It highlights the first row, "Dim strMsg As String"? If so, check this
link
to repair your References.

http://www.allenbrowne.com/ser-38.html

--
Wayne Morgan
MS Access MVP


Well thanks for the response
This is the code I have now
Private Sub Command33_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are
ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data")
=
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If

It says compile error and hilights the first row.
Can you help me in figuring out where I went wrong.
Thanks

:

Yes, it can be done by using the MsgBox function instead of the MsgBox
statement (note the parentheses in the new statement). Also, the first
If...Then line can be shortened slightly.

Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
'variable used to make MsgBox function shorter and easier to read
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are
ready
to
submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete
Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
'I'm just guessing on what you might want here
Me.Undo
DoCmd.Close acForm, Me.Name, acSaveNo
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another
Test
Mileage]![ID]"

'DoCmd.Close
'I recommend that you specify what to close
'otherwise, you'll close the item with the focus
DoCmd.Close acForm, Me.Name, acSaveNo

--
Wayne Morgan
MS Access MVP


I have this code for a command button
If (IsNull(Me.[TA Created By]) Or Me.[TA Created By] = "") Then
MsgBox "Please Choose POV GIVEN TO-Only Continue if you are ready
to
submit POV."
Me.[TA Created By].SetFocus
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, ,
"[ID]=[Forms]![Another
Test
Mileage]![ID]"

DoCmd.Close
When the error mesg. pops up I would like a yes no box. That says
yes
continue or no Close. So if it is yes return to form, if no then
close.
Can this be done?
Thanks for your help.
Cheyenne
 
G

Guest

something else I forgot to mention, if everything is okay, then I want it to
open a report. Where does that go in the mix of all of this? The report
name is Mileage.

Mike Brearley said:
You're missing an end if, just as the error states. You have two if
statements, and one end if. Try this:

Private Sub Command156_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data")
= vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If
End If
End Sub


Chey said:
I pasted the code to a new command button. Now it says compile error
Block if without end if
this is what I have
Private Sub Command156_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If

End Sub

Thanks again for all your help.

Wayne Morgan said:
It highlights the first row, "Dim strMsg As String"? If so, check this
link
to repair your References.

http://www.allenbrowne.com/ser-38.html

--
Wayne Morgan
MS Access MVP


Well thanks for the response
This is the code I have now
Private Sub Command33_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are
ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete Data")
=
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If

It says compile error and hilights the first row.
Can you help me in figuring out where I went wrong.
Thanks

:

Yes, it can be done by using the MsgBox function instead of the MsgBox
statement (note the parentheses in the new statement). Also, the first
If...Then line can be shortened slightly.

Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
'variable used to make MsgBox function shorter and easier to read
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are
ready
to
submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete
Data") =
vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
'I'm just guessing on what you might want here
Me.Undo
DoCmd.Close acForm, Me.Name, acSaveNo
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, , "[ID]=[Forms]![Another
Test
Mileage]![ID]"

'DoCmd.Close
'I recommend that you specify what to close
'otherwise, you'll close the item with the focus
DoCmd.Close acForm, Me.Name, acSaveNo

--
Wayne Morgan
MS Access MVP


I have this code for a command button
If (IsNull(Me.[TA Created By]) Or Me.[TA Created By] = "") Then
MsgBox "Please Choose POV GIVEN TO-Only Continue if you are ready
to
submit POV."
Me.[TA Created By].SetFocus
Exit Sub
End If
DoCmd.OpenReport "For Mileage", acViewNormal, ,
"[ID]=[Forms]![Another
Test
Mileage]![ID]"

DoCmd.Close
When the error mesg. pops up I would like a yes no box. That says
yes
continue or no Close. So if it is yes return to form, if no then
close.
Can this be done?
Thanks for your help.
Cheyenne
 
W

Wayne Morgan

Mike was correct about the second End If.


No, you need to put the name of the form in the second argument. The easiest
way to do this is:

DoCmd.Close acForm, Me.Name, acSaveNo

"Me.Name" will return the name of the form that is running the code. Type it
exactly as I have it. Don't substitute in the form's name.
 
W

Wayne Morgan

Open the report between the second End If and the End Sub. See if that does
the Open when you want it done.

--
Wayne Morgan
MS Access MVP


Chey said:
something else I forgot to mention, if everything is okay, then I want it
to
open a report. Where does that go in the mix of all of this? The report
name is Mileage.

Mike Brearley said:
You're missing an end if, just as the error states. You have two if
statements, and one end if. Try this:

Private Sub Command156_Click()
Dim strMsg As String
If (Nz(Me.[TA Created By], "") = "") Then
strMsg = "Please Choose POV GIVEN TO-Only Continue if you are
ready
to submit POV."
If MsgBox(strMsg, vbRetryCancel + vbExlcamation, "Incomplete
Data")
= vbRetry Then
Me.[TA Created By].SetFocus
Exit Sub
Else
Me.Undo
DoCmd.Close acForm, Me.[Another Test Mileage], acSaveNo
Exit Sub
End If
End If
End Sub
 

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