By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,171 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

Selected From Combo Box or Typed In?

P: n/a
a2k (9.0.6926) SP-3 Jet 4.0 SP-7

I have a form with combo box field that allows the user to select from
the combo box or type in the field value that may or maynot be in the
combo box field.

In the After Update Event of the combo box field how can I tell if the
field value was selected from open combo box or typed in by the user?

Thanks, John
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On 30 Dec 2003 07:47:42 -0800, Su**********@aol.com (Support4John)
wrote:
a2k (9.0.6926) SP-3 Jet 4.0 SP-7

I have a form with combo box field that allows the user to select from
the combo box or type in the field value that may or maynot be in the
combo box field.

In the After Update Event of the combo box field how can I tell if the
field value was selected from open combo box or typed in by the user?

Thanks, John


Set the combo box's Limit To List property to Yes and monitor (with
code) the OnNotInList event. When the OnNotInList event fires the user
has typed in something not in the list.

- Jim

Nov 12 '05 #2

P: n/a
I didn't explain myself very well

What I need to know in combo After Updare Event is, did I select the
vale from a OPEN combo box or did I just type in the value from a
CLOSED combo box?.

Say the word "Fox" is in the combo box, did I open the combo box and
select it, or did I just type in the word "Fox" without opening the
combo box?

Is it possible to tell in the combo After Update Event which way the
field was filled in?

Thanks, John
Ji****@NOTdatacentricsolutions.com (Jim Allensworth) wrote in message news:<3f**************@netnews.comcast.net>...
On 30 Dec 2003 07:47:42 -0800, Su**********@aol.com (Support4John)
wrote:
a2k (9.0.6926) SP-3 Jet 4.0 SP-7

I have a form with combo box field that allows the user to select from
the combo box or type in the field value that may or maynot be in the
combo box field.

In the After Update Event of the combo box field how can I tell if the
field value was selected from open combo box or typed in by the user?

Thanks, John


Set the combo box's Limit To List property to Yes and monitor (with
code) the OnNotInList event. When the OnNotInList event fires the user
has typed in something not in the list.

- Jim

Nov 12 '05 #3

P: n/a
On 31 Dec 2003 08:32:18 -0800, Su**********@aol.com (Support4John)
wrote:
I didn't explain myself very well

What I need to know in combo After Updare Event is, did I select the
vale from a OPEN combo box or did I just type in the value from a
CLOSED combo box?.

Say the word "Fox" is in the combo box, did I open the combo box and
select it, or did I just type in the word "Fox" without opening the
combo box?

Is it possible to tell in the combo After Update Event which way the
field was filled in?

Thanks, John

Hmm, well you could assemble the input by coding the On Key Press
event. Use a module level variable to hold the assemblage and then
check it in Before Update and clear it in After Update.

- Jim
Nov 12 '05 #4

P: n/a
Support4John wrote:
a2k (9.0.6926) SP-3 Jet 4.0 SP-7

I have a form with combo box field that allows the user to select from
the combo box or type in the field value that may or maynot be in the
combo box field.

In the After Update Event of the combo box field how can I tell if the
field value was selected from open combo box or typed in by the user?

Thanks, John

You can use the 'OnNotInList' event, instead of the 'AfterUpdate'.

Mike W :)
Nov 12 '05 #5

P: n/a
Any example code?
Nov 12 '05 #6

P: n/a
On 3 Jan 2004 08:48:47 -0800, Su**********@aol.com (Support4John)
wrote:
Any example code?


John, I'm not sure what you are trying to do with this, but maybe the
following will give you some idea of an approach.

Assuming a combo box name cboMyCombo. Not knowing your row source type
and what you are doing with the input...

First create a module variable - at the top of the module in the
Declarations section:

Dim mstrCbo As String

Code like the following in the appropriate control events:

Private Sub cboMyCombo_KeyPress(KeyAscii As Integer)
Dim str As String

str = Chr(KeyAscii)
If str Like "[a-zA-Z0-9]" Then
mstrCbo = mstrCbo & Chr(KeyAscii)
End If
End Sub

Private Sub cboMyCombo_BeforeUpdate(Cancel As Integer)
Dim intItems As Integer

If Len(mstrCbo) > 0 Then
For intItems = 1 To Me.cboMyCombo.ListCount
If Me.cboMyCombo.Column(0, intItems - 1) = mstrCbo Then
MsgBox mstrCbo & " is in list!"
Exit For
End If
Next
End If
End Sub

Private Sub cboMyCombo_AfterUpdate()
mstrCbo = ""
End Sub

- Jim
Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.