Assigning vbYes and vbNo

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.
 
S

Stefan Hoffmann

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 <--
 
Top