K
khel
I have the following written to the NotInList event to add a new name to a
combo box in a form:
Option Compare Database
Option Explicit
Private Sub Combo16_NotInList(NewData As String, Response As Integer)
Dim strMsg As String
strMsg = "Add new field name?"
If MsgBox(strMsg, vbYesNo) = vbYes Then
'open form and pass NewData
DoCmd.OpenForm "frmField Info", , , , acFormAdd, acDialog, NewData
Response = acDataErrAdded 'tell access to requery combo
Else
'cancel even and undo typing
Response = acDataErrContinue
Me.Undo
End If
End Sub
However, after I return from the referenced form "frmField Info" to the
original form I am no longer on the same record. I have advanced to the next
record with only the updated field on the preceding added record. Any
suggestions on how to return to the correct record? Thanks!
combo box in a form:
Option Compare Database
Option Explicit
Private Sub Combo16_NotInList(NewData As String, Response As Integer)
Dim strMsg As String
strMsg = "Add new field name?"
If MsgBox(strMsg, vbYesNo) = vbYes Then
'open form and pass NewData
DoCmd.OpenForm "frmField Info", , , , acFormAdd, acDialog, NewData
Response = acDataErrAdded 'tell access to requery combo
Else
'cancel even and undo typing
Response = acDataErrContinue
Me.Undo
End If
End Sub
However, after I return from the referenced form "frmField Info" to the
original form I am no longer on the same record. I have advanced to the next
record with only the updated field on the preceding added record. Any
suggestions on how to return to the correct record? Thanks!