473,564 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

auto expand on combo box with autofill VBA format issue stops auto expanding

4 New Member
I have created a form that has a combo box and that combo box has VBA code that gets other fields to autofill but the problem is my combo box no longer auto expands as I type in in my case a book title into the combo box. I have narrowed the issue down to the price field it has something to do with the currency format.

If I remove it from the code and the auto expand works again and all field bar price autofill. the number format field doesn't cause any issues just the price.

I have tinkered further and I think it is to do more with the fact the price field is used in a calculated field sub total field [price]*[quantity].
May 4 '14 #1
6 2170
jimatqsi
1,274 Recognized Expert Top Contributor
Dgreenwood,
Welcome to Bytes.

You need to do a better job of explaining your problem and what you have done so far. You're typing a book title and you think the price field has something do with the list of book titles not auto-expanding? You have to help us make sense of that because we can't possibly guess what the connection is between those two.

"If I remove it from the code and the auto expand works again ..."
What is "it", currency formatting? Again, what has currency formatting to do with book titles?

"all field bar price autofill. " What are you saying here? You have multiple columns in your combobox and the column for price is not filling in? Or you have multiple combo boxes and the combo box for price does not work?

Please show us the any code you have. And what version of Access are you using? Be clear about what you have and what does not work.

Jim
May 4 '14 #2
Dgreenwood
4 New Member
Sorry,

Microsoft Access 2010

In my Form "Book Purchase" I have the following fields Autofilling from a comboBox field called "search" that has all the information linked via lookup wizard from the "Books" table.
ISBN Number (PK)
Title (of the Book)
Number in stock
Price

The code used to autofill the fields and is currently working fine is.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmoSearch_Change()
  2. Me.txtTitle.Value = Me.cmoSearch.Column(1)
  3. Me.txtISBN_Number.Value = Me.cmoSearch.Column(0)
  4. Me.txtNumber_in_Stock.Value = Me.cmoSearch.Column(2)
  5. Me.txtPrice.Value = Me.cmoSearch.Column(3)
  6. End Sub
There are 2 other fields in the form
Quantity (user selects how many to purchase)
Sub Total (calculated field [price]*[quantity])

all the fields autofill fine the comboBox will only let me type in 1 letter and will auto fill the information into the relevant fields. So no expanding I have to use the drop down.

If I remove the line of code the autofills price the comboBox works perfectly and all the fields left in the code autofill perfectly.

I hope that is clearer



Attached Images
File Type: jpg form_Issues.jpg (38.4 KB, 684 views)
File Type: jpg relationships.jpg (43.3 KB, 782 views)
May 4 '14 #3
jimatqsi
1,274 Recognized Expert Top Contributor
That is clearer, but still not clear. All was good until the last bit. "If I remove the line of code the autofills price the comboBox works perfectly and all the fields left in the code autofill perfectly."

Are you saying that if you remove
Expand|Select|Wrap|Line Numbers
  1. Me.txtPrice.Value = Me.cmoSearch.Column(3)
then one of your combo boxes works better?

I don't really think that is the case. If that is what you think you see, I think you should look closer at what is happening. If txtPrice is really just a text box then I don't think filling it will change the behavior of a combo box.

I could be wrong, but I encourage to fiddle with it a while and see if something obvious doesn't bubble up to the surface.

Also, be sure to use code tags when you post code. Click the [CODE/] button and paste your code between the tags.

Jim
May 4 '14 #4
Dgreenwood
4 New Member
I have had a good tinker and the "Sub Total" field in the "Book Purchase" table is causing the problem (which is in the form "book Purchase" but is the source of the data.

It is a calculated field and when I have removed the calculation format the Combo Box for "select" works fine but the subtotal no longer works obviously.

I have had a look on the settings and can't see anything but I am guessing that as soon as I press a letter in the combo Box the fields auto fill and then the subtotal has data to make its calculation and prevents the auto expand from working. It simply enters the first result under the letter pressed.

the VBA code is built on the event "on Change" should this be moved to something else?
May 5 '14 #5
Dgreenwood
4 New Member
Moved the event to "after update" and it works go me!
May 5 '14 #6
jimatqsi
1,274 Recognized Expert Top Contributor
Yes, you made exactly the right move. OnChange is fired after every change within the value, OnUpdate is fired after the edit of the field is completed.

Good job!

Jim
May 5 '14 #7

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

Similar topics

2
2086
by: Jim Devenish | last post by:
I have a combo box with Auto Expand and Limit to List both set to 'yes'. When I type 'C' I correctly get: C J Valeting When I type 'CO' I get: Cogent Seating Ltd again correct BUT when I go on to type 'COM', looking for 'Commercial Motors', I get (incorrectly)
3
2585
by: Joey Powell | last post by:
Is it possible to specify a format string for one or more auto-generated datagrid columns? If so, could someone post an example? More specifically, I am interested in taking output like 27.0800000 and turning it into 27.08 I have also tried doing this with the underlying SQL statement, but I can't get it to work that way, either.
1
2684
by: pemigh | last post by:
In a prior posting (too old to reply directly), Jim Devenish described exactly what my client has seen, both in terms of AutoExpand behaving oddly and the way that caps lock relates to the situation. The problem is hard to nail down because 1) the combo box misbehaves only for certain combo box entries and 2) it won't necessarily misbehave...
3
7863
by: joseph.mccastlain | last post by:
Hello All, I am a new user to Access. I am currently designing a database consisting of four tables for multiple users. Rather than bore you with the goals and such, here is what I am attempting to do: I have two combo boxes, the first of which contains three text values (Org 1, Org 2, Org 3) and the second combo box contains a listing of...
4
14170
by: magmike | last post by:
I've got a control on my form that allows the user to select a record based on a form field (in this example, the drop down menu shows the company name, followed by the contact name but uses the contactid to change the data on the form). Most users, start typing the company name which will auto complete itself with the first entry with the...
3
3237
klarae99
by: klarae99 | last post by:
Hello, I am using Access 2003 to design an inventory database. Please be pacient with this question, I am not sure how exactly to explain what is happening concisely but I will do my best. I have a form bound to my products table that has two cascading combo boxes, one for category and one for subcategory. When entering a new item these...
3
17229
by: Simon van Beek | last post by:
Dear reader, What can be wrong in my ComboBox, the property "Auto Expand" is set to Yes, but by typing in the ComboBox it doesn't expand. Is this because the source of the ComboBox is a query.
1
4443
by: janakrai | last post by:
how to auto expand drop down combo box in onfocus event like click event
7
2458
by: dorandoran | last post by:
I used this article (http://www.codeproject.com/KB/webforms/EditNestedGridView.aspx) to accomplish expand/collaspe grid. I also added a search and it works. but i need to be now automatically expand the corresponded grid where search was found. User has to click on all the parent grid to find out which child grid has records. How can I...
1
1584
by: Kanapaha | last post by:
Initially the combo box (cboSearchName) was working fine but for no apparent reason it now works for only the first two characters typed. In other words, if I have the names Smith and Small; Small appears (as it should) when I type SM. If I continue to type SMI, the "I" is inserted before the "all". If I continue to type out SMITH, I end up...
0
7888
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6255
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.