The Docmd in this IF/Then Statement will not work

C

Curtis

I am using the below coding and can not figure out why the "Else" DoCmd will
not work. Debug shows no errors yet if "NO" is clicked in the message box the
DoCmd.Close fails to work. Any idea why?

Function Another_Record()

MSGBOX "Do you wish to do another LRU update?", vbYesNo, "LRU UPDATE"
If vbYes Then
DoCmd.GoToControl "Serial Number"
Else
DoCmd.Close acForm, "EDIT CDS LRU ASSET"
End If
End Function
 
M

Marshall Barton

Curtis said:
I am using the below coding and can not figure out why the "Else" DoCmd will
not work. Debug shows no errors yet if "NO" is clicked in the message box the
DoCmd.Close fails to work. Any idea why?

Function Another_Record()

MSGBOX "Do you wish to do another LRU update?", vbYesNo, "LRU UPDATE"
If vbYes Then
DoCmd.GoToControl "Serial Number"
Else
DoCmd.Close acForm, "EDIT CDS LRU ASSET"
End If
End Function


There is no reason why you would need to post the same
question twice in 12 minutes. Have a little patience and
give us a chance to answer. Check your posts for replies
and don't think about reposting the same question for a
couple of days.
 

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