G
Guest
My main form has three places where people's names go. All three use combo
boxes that utilize a Select query (written into the properties window) to
pull information from a contacts table. The query pulls first names, last
names, middle initials and contactID numbers. It displays the full names
(first mi Last), but stores the ID. When the "NotInList" event fires, and
the user agrees to "add" a name, a form "PopupContacts" opens in dialogue
form mode for data entry.
In the "PopupContacts" form there are three events in the code. Two are for
"ok" and "cancel" buttons on the "PopupContacts" form. The third is this:
Private Sub Form_Load()
If Len(Me.OpenArgs) > 0 Then
Me.[First Name] = Me.OpenArgs
End If
End Sub
The problem is as much design as it is coding, I suppose, but I like the way
things are except: Someone will type in a first and last name (and possible
middle initial) and when they go to add the new person to the contacts, all
that name info will be deposited into the firstname field. Is there a way
for me to code it so it will recognize the spaces and send each name to the
appropriate control on the popupcontacts form (eg if there are three distinct
character groups, but the first one in the firstname, the second in the MI
and the third in the lastname; if there is only two, first goes to firstname
and second goes to lastname)? I realize this won't always work properly, but
it would be nice if it worked with a "standard" first name, middle initial,
last name situation, or maybe even just a first name last name situation.
Thanks (again),
CW
boxes that utilize a Select query (written into the properties window) to
pull information from a contacts table. The query pulls first names, last
names, middle initials and contactID numbers. It displays the full names
(first mi Last), but stores the ID. When the "NotInList" event fires, and
the user agrees to "add" a name, a form "PopupContacts" opens in dialogue
form mode for data entry.
In the "PopupContacts" form there are three events in the code. Two are for
"ok" and "cancel" buttons on the "PopupContacts" form. The third is this:
Private Sub Form_Load()
If Len(Me.OpenArgs) > 0 Then
Me.[First Name] = Me.OpenArgs
End If
End Sub
The problem is as much design as it is coding, I suppose, but I like the way
things are except: Someone will type in a first and last name (and possible
middle initial) and when they go to add the new person to the contacts, all
that name info will be deposited into the firstname field. Is there a way
for me to code it so it will recognize the spaces and send each name to the
appropriate control on the popupcontacts form (eg if there are three distinct
character groups, but the first one in the firstname, the second in the MI
and the third in the lastname; if there is only two, first goes to firstname
and second goes to lastname)? I realize this won't always work properly, but
it would be nice if it worked with a "standard" first name, middle initial,
last name situation, or maybe even just a first name last name situation.
Thanks (again),
CW