473,399 Members | 3,106 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,399 software developers and data experts.

ComboBox dropdown.

25
Is there an event I can use when a user slelects the dropdown from a ComboBox on a form, either by clicking it or pressing F4?
Feb 22 '08 #1
6 2115
sierra7
446 Expert 256MB
Hi
It's usually the After_Update event

What are you trying to do ?

S7
Feb 22 '08 #2
Codebug
25
I want to run a function based on the text typed into the combobox, so that the user can select a valid input. The field has a suffix at the end indicating a unique entry based on how many times it has been entered.

I already have a function that will return the correct result in the ComboBox List, I just need it to be called if the user decides to pull down the ComboList to select the next in the seqence, otherwise the user has to manually work out the next in the sequence.

ie the records are stored as follows:

SN = "1234"

SN = "1234-1"

SN = "1234-2"

so if the user next types "1234", it will display "1234-3" in pull down list.

The function is simply an SQL that opens records matching "1234*" and then based on the record count.
Feb 25 '08 #3
sierra7
446 Expert 256MB
Hi
It sounds like you have done the difficult bit, to write the function to 'get next value'. If you want to display this in the combo box you can use the After_Update event ;-
Expand|Select|Wrap|Line Numbers
  1.  Private Sub Combo0_AfterUpdate()
  2. Me.Combo0 = getNextValue(Me.Combo0)
  3. End Sub
It's as simple as that so long as the FIRST column in the combo is VISIBLE and the property 'Limit to List' (on the Data tab) is set to 'No'

I hope I have understood correctly

BTW, I trust you know where you are going with this data structure? You are seemingly generating a 'compound' field which BREAKS THE FIRST RULE of database design and normalization.

By keeping your '1234' in one column (field) it can remain numeric, so faster to index and search, and the '4'th occurance can also be stored as a number in an adjacent column. etc, etc. If you want to display '1234-4' you can.

Ofcourse, I've no idea whether this is what you are already doing !

S7
Feb 25 '08 #4
Codebug
25
Yes thanks for your help,


yes that is correct, the data for this field is generic from a serial number of a product. And the data structure was something I had inherited when I took on the design of it.

Every time the product is returned for repair it is entered into the database, with a unique indexed field.

the serial number can be alphanumeric ie S124-2 (Second Time product was returned).
Feb 25 '08 #5
Codebug
25
Ok, still having problems


After_Update event not working as the user may sometimes want to drop down before moving to another input field (When the field gets updated)

have tried a routine using on change, but cannot get the data the user has typed into the combobox, the combobox value only returns the last updated value, not whats displayed in the combobox
Feb 25 '08 #6
sierra7
446 Expert 256MB
Well I wasn't too happy with what you were doing anyway! You would have to put in some check to stop a user casually dropping the box and creating a 'new part' or up-issuing and old one, when not intentional. But it is difficult from this side of the screen not knowing the full story.

I think the 'On_Change' event fires as soon as a change is detected without waiting for the full change, whereas 'After_Update' does what it says on the tin.

It sounds to me that you really need a command button saying "Get Next Issue"; it might not be a bad idea to make it have a message box saying "Are you sure?" You could still display the compound value back in the combo box.

I hear what you say about your SN numbers but I have 'been through the hoop' with Drawing Offices and seen most of the numbering sequences they invent, particularly for keeping traceability of assemblies and the like. Hats off to them because they managed without computers for a hundred years. I'd bet the 'S' means something to somebody; if they are still alive! But if you do your data analysis properly you should bottom out all these issues so that you can use today's tool effectively. You can still display what they want to see; it's what's under the hood that counts.

Sometimes you have to take a step back in order to go forward.
S7

PS That wasn't meant as a rant but does have good intentions.
Feb 25 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: jean | last post by:
hi: i am developing a custom combobox for my company's needs that is made up of a textbox, listbox, button. i am using c#. everything is fine except for one issue. in a normal combobox,...
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
7
by: NCrum | last post by:
I want to set the Default value of a Combobox for any changeable record and have got this working but it is totaly unsatisfactory see the code below I loop through the items in the Combo looking...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
1
by: Norm Katz | last post by:
When you use a bound combobox and you set its dropdown style to "dropdown" that allows you to enter text in the edit box. But if you enter anything other than a value in the current bound items...
0
by: Mike | last post by:
Hi all! I have an OwnerDrawVariable ComboBox in .net. In the ComboBox DropDown event I display another control - works well. In the control's Leave event I remove the control - works well. So...
4
by: Kalvin | last post by:
I have seen this question raised, but I cannot find an answer. I have an MDI app, when I load an child form with a combobox being bound in the load event, it won't allow me to set selectedindex =...
0
by: | last post by:
Hi All. I have a problem with combobox, what I want is when combobox gets focus I need it to show the dropdown list t.This is fine if the user selects the combobox via keystrokes but when the...
5
by: Gil | last post by:
Is there a way to tell if a combbox is in dropdown mode. I tried and if statement combobox.dropdown = true but i get an error. dropwndown function doesnt store if its true or false what i am...
1
by: amber | last post by:
I'm having an issue with a combobox that is making no sense to me at all. I have a form with several comboboxes/textboxes. The values in these boxes are based on a datarowview, which is based on...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.