NotInList Repeat

  • Thread starter Thread starter GGG
  • Start date Start date
G

GGG

I am trying to get out of this infinate loop with NotInList

What happens is when a number is entered in the list, a new form opens,
which data, associated with it is then entered. Once that form is
closed (I couldn't get anything to work programmically, at the exit of
the last row, without complications, I had to put in a button to close
the damned form.
Does anyone have a fix, or idea that will close the form without a
question to save the existing form, or an object error??
Then when the underlying form is closed (fmNSN_entry), the cursor is
still in the same location as it was before I went into this form.
When I try to exit out of it, it just goes through the same cycle
again. What I want this thing to do is EXIT out of this section once
the underlying form has it's data filled in (the last field, called UI.
But, I don't have ideas on how to do this and have spent a good
amount of time to get a fix for this.

I do not want to have to hit "escape" twice in order to get out of
this. There has to be a more sensible way to do this.

Ideas? Need more code? I can provide if that'll help you be able to
solve this. I have tried me.requery in a few spots without any
successes.

The initial code is as follows

Private Sub cbMSlu_NotInList(NewData As String, Response As Integer)
Dim cteNidia As String
Response = acDataErrContinue
If MsgBox("Would you like to add this new NSN?", vbYesNo) = vbYes
Then
cbMSlu.Tag = "All_In" 'Adding a record on the form. Will also
tell the other form _
to fire off certain happenings only if this is labeled.
DoCmd.OpenForm "FmNSN_entry"
DoCmd.GoToRecord , , acNewRec
Forms!fmnsn_entry.NSN = Forms!entryofPOs!cbMSlu.Text


'Me!NSN.Value = cteNidia

'Forms!fmnsn_entry!NSN.Value = cteNidia

Response = acDataErrContinue 'having this here eliminates "not a
value on the list"
' Me.Requery
' (all me.requery does is bring up the fact that I have a value that
is not in the list, so, it doesn't work here)

end sub
 
Back
Top