473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Selected From Combo Box or Typed In?

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
6 3532
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
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
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
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
Any example code?
Nov 12 '05 #6
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
4
by: Mike L | last post by:
Currently, when the user presses a letter key the combo box will go to the first item in the collection of the combo box starting with that letter. For example user presses on "R", and "R2F"...
2
by: Brian Henry | last post by:
say I have a databound combo box, which allows for text entry still (DropDownStype = DropDown in this case). now, If the user doesn't enter manually an item in the data bound list, nothing...
4
by: Shyguy | last post by:
I have a combo box that searches for records in the database. When a name is typed in that is not in the database, Access shows a message box that says, The test you entered isn't an item in...
2
by: mumbaimacro | last post by:
hi i have two combo boxes in a form with values from a table. i need a report to be opened by a button from the form ,The Report should show the values selected in the combo boxes in the form...
3
by: mf193 | last post by:
Hi, I have a table of around 1000 rows; patient records. Each row is individually defined by a Patient ID number which is my primary key. I have made a simple form to display patient information...
19
by: pdesh3 | last post by:
I am developing an application for a hospital which provides Outpatient billing information. I have created appropriate tables required. I have to develop a client server system where from multiple...
0
daniel aristidou
by: daniel aristidou | last post by:
From what i know, to do this you bind a combo to a datatable. (so the data keeps even when the file is shut) You then add code that tells the combo box to add a new row with the data typed into the...
9
by: ajos | last post by:
Hello friends, After thinking about this for sometime, i decided to post this in the java forum. Well my problem here in detail is, i have 3 jsp pages where in a.jsp(for example) i have a combo...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.