Small NotInList issue...

G

Guest

I have a NotInList on my main form that opens my contacts form (a modified
version in dialogue mode) when a user types in a name that isn't in the list.
It parses the way I want it to, and it adds the name back to the combo box
list the way it should, but there's one problem.

If I put a name that's not in the list in the main form combo box, fire the
NIL event which opens the form, and then make slight modifications to the
name in the popup contacts form (changes from what I typed originally in the
combo box on the main form), it doesn't push those changes back to the combo
box text box (where the original mispelled name was typed in the first
place). Therefore, the entry that was added to the combo box based on what
was actually saved in the popup form is different from what was typed in the
combo box and I get an err saying it's not in the list.

This code appears in the popup form. It's a part of a solution that someone
around here has on their website, but I can't remmber who:

Private Sub Requesting_Party_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Dim varFullName As String

varFullName = Me.[Last Name] & ", " & Me.[First Name]

If Len(Me.txtMI) > 0 Then
varFullName = Me.ID & varFullName & " " & Me.txtMI
End If

Me.[Requesting Party] = varFullName

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Requesting Party], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Everything from the varFullName declaration to the Me.[Requesting Party]
line I added in an attempt to push the modified results to the main form
[Requesting Party] field. It's important to note that this appears in the
popup contacts form, but works for updating the choices in the combo box
because hitting "ok" on the popup contact form only sets the forms visible
property to false (it's closed after the recordset updates in the combo box).

I need to replace what was originally typed into the combo box with what was
actually typed into the popup contacts form so that event won't fire a second
time.

One other note: the combo box on the main form is based on a select query
typed into the rowsource property that is two columns wide, the first column
being the ID of the contract with a column width of 0. I'd think that would
be the problem, and maybe it is, but I don't know. If it IS the problem,
it's preventing even the string from ever appearing in the main form.

Thanks for any help with this....I'm so ready to get past this one issue.

CW
 

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

Top