Assigning vbYes and vbNo

  • Thread starter Thread starter shane
  • Start date Start date
S

shane

I would like a vbYesNo msgbox that would open a form on the last record if
"No" is chosen and open the same form on a new record if "Yes" is chosen.

How can this be done?

Thanks In Advanced.
 
hi Shane,
I would like a vbYesNo msgbox that would open a form on the last record if
"No" is chosen and open the same form on a new record if "Yes" is chosen.
How can this be done?
This should work:

Dim FormName As String
Dim Result As Long

FormName = "youForm"
Result = MsgBox("New Record?", vbYesNo)
DoCmd.OpenForm FormName
If Result = vbYes Then
DoCmd.GoToRecord,, acNew
Else
DoCmd.GoToRecord,, acLast
End If



mfG
--> stefan <--
 

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

Back
Top