I have a list box that is limited to list. I want to be able to add to the list via a message box. this is what I'm using at present, and it works OK. But this opens up a second form, 'ExerciseName' where the user has to press 'Enter'. What I want to do is cut that form out of the equation, but Im unsure what to change in my code. Any ideas anyone? Thanks!
Response = MsgBox(Me.Exercise_Name & "is not recognised in this database." & vbCrLf & vbClRf & "Would you like to add it?", vbQuestion + vbYesNo, "Unrecognised Sata")
If Response = vbYes Then
DoCmd.OpenForm "ExerciseName", acNormal, , , acFormAdd, acDialog, NewData
Response = acDataErrAdded
Else
Me.Exercise_Name.Undo
Response = acDataErrContinue
End If
Response = MsgBox(Me.Exercise_Name & "is not recognised in this database." & vbCrLf & vbClRf & "Would you like to add it?", vbQuestion + vbYesNo, "Unrecognised Sata")
If Response = vbYes Then
DoCmd.OpenForm "ExerciseName", acNormal, , , acFormAdd, acDialog, NewData
Response = acDataErrAdded
Else
Me.Exercise_Name.Undo
Response = acDataErrContinue
End If