473,804 Members | 3,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

combo box lookup problem

I have a form with some combo boxes used as lookup fields: customer
Name, Customer Number, Address, Phone number. I have imported the
customer information form another data base. The lookup fields are
designed to be able to search for a customer and display all of its
info at the bottom of the form. 90% of the customers work fine. There
are some that won't display thier info. It seems that only the lookup
field for Customer Name is not working all the time, the rest work.
If you type in a customer's name, it will stay in the lookup field and
not display on the bottom of the form, If you type in thier address or
account number, it works. I've tried to delete the customer record and
re-enter it, but I get the same results. Why is this not working with
some and works fine with the rest?

Mar 28 '06 #1
9 2297
linda wrote:
I have a form with some combo boxes used as lookup fields: customer
Name, Customer Number, Address, Phone number. I have imported the
customer information form another data base. The lookup fields are
designed to be able to search for a customer and display all of its
info at the bottom of the form. 90% of the customers work fine. There
are some that won't display thier info. It seems that only the lookup
field for Customer Name is not working all the time, the rest work.
If you type in a customer's name, it will stay in the lookup field and
not display on the bottom of the form, If you type in thier address or
account number, it works. I've tried to delete the customer record and
re-enter it, but I get the same results. Why is this not working with
some and works fine with the rest?

Since you say it works for 90% of the customers and not for the other
10% then I would suggest you have a relationship line in the query
(wherever that is) that is an inner join, not a Left join.

For example, lets say I had a customer table and a customer type table.
The customer type tells the op if it is a Big account or Small
account. You have a field in Customer call CustomerType. In 90% of the
records, you have a customer type. In the other 10, it is missing.
Since the query is linking the customer to the type, and the type isn't
found, it can't be displayed as it doesn't meet your criteria.

Anyway, I am 90% sure that that is your problem...a query that looks
good but doesn't allow for all records to be displayed. If the query
can be viewed in the query builder, dbl-click on the relationship line
to change the join type.
Mar 28 '06 #2
That does make sence, but I don't think that's the problem, I dont'
have a query, I used combo boxes. I looked at the combo's in visual
basic, and I don't see anything wrong with them, combo 32 is the one
that doesn't see all of the customer names, combo 34 has always worked
fine. Is there another query that it may have generated that I'm not
aware of?
Private Sub Combo32_AfterUp date()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Cl one
rs.FindFirst "[CustomerName] = '" & Me![Combo32] & "'"
Me.Bookmark = rs.Bookmark

Me!Combo32.Valu e = ""
End Sub

Private Sub Combo34_AfterUp date()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Cl one
rs.FindFirst "[Address] = '" & Me![Combo34] & "'"
Me.Bookmark = rs.Bookmark

Me!Combo34.Valu e = ""
End Sub

Mar 29 '06 #3
That does make sence, but I don't think that's the problem, I dont'
have a query, I used combo boxes. I looked at the combo's in visual
basic, and I don't see anything wrong with them, combo 32 is the one
that doesn't see all of the customer names, combo 34 has always worked
fine. Is there another query that it may have generated that I'm not
aware of?
Private Sub Combo32_AfterUp date()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Cl one
rs.FindFirst "[CustomerName] = '" & Me![Combo32] & "'"
Me.Bookmark = rs.Bookmark

Me!Combo32.Valu e = ""
End Sub

Private Sub Combo34_AfterUp date()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Cl one
rs.FindFirst "[Address] = '" & Me![Combo34] & "'"
Me.Bookmark = rs.Bookmark

Me!Combo34.Valu e = ""
End Sub

Mar 29 '06 #4
linda wrote:
That does make sence, but I don't think that's the problem, I dont'
have a query, I used combo boxes. I looked at the combo's in visual
basic, and I don't see anything wrong with them, combo 32 is the one
that doesn't see all of the customer names, combo 34 has always worked
fine. Is there another query that it may have generated that I'm not
aware of?
Open up your form in design mode. In the data tab, copy the
recordsource to the clipboard (if SQL, else open up the query). Now
open up a new query in design mode, don't add tables, click View/SQL
from the menu, and paste the SQL into it.

Now, open up the customer table and get the customer id for your problem
customer. Now see if that customer ID exists in the recordset of the
new query. I doubt it exists.

If it DOES exist, then check for any filters you may have set in the form.


Private Sub Combo32_AfterUp date()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Cl one
rs.FindFirst "[CustomerName] = '" & Me![Combo32] & "'"
Me.Bookmark = rs.Bookmark

Me!Combo32.Valu e = ""
End Sub

Private Sub Combo34_AfterUp date()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Cl one
rs.FindFirst "[Address] = '" & Me![Combo34] & "'"
Me.Bookmark = rs.Bookmark

Me!Combo34.Valu e = ""
End Sub

Mar 30 '06 #5
I wild guess:

You say this works 90% of the time.

1st: Check to see if you can get the Customer Name to show in a simple
query. If you can't then maybe the data was entered incorrectly. Are
there leading spaces in the data fields? See if you can get it to work
without a combo field first (query). When it's working in a query,
then get the combo field going again.

2nd: Are there mutliples of a last name? and if so is your form
'allowed' to display multiple records?

See if you can get it to work in a query and then slowly build in the
more complicated features.

Good luck.

Clare Allan

Mar 30 '06 #6
Ok, I've tried that, the customer is in there and I don't have any
filters set on the form or query. Now what?

Mar 31 '06 #7
is it possible that when you select one combo field Combo34=address
then it filters out customers in Combo 32=Name who don't have an
address that is possible when the content of address is X ?

Also, I would start with a simple query with basic prompt parameters
(and query for the customers that don't show), when that works, create
a blank form and throw a combo box=name on it. Make that work. Then,
put an address combo box on the form and see if you can get it to work
there. BTW, did you confirm that you are able to get the customers to
appear in a simple query? If you can, then build your framework bit by
bit.

Also, is it always the same customers that don't show? There might be
something there.

Mar 31 '06 #8
tr*******@lycos .com wrote:
is it possible that when you select one combo field Combo34=address
then it filters out customers in Combo 32=Name who don't have an
address that is possible when the content of address is X ?

Also, I would start with a simple query with basic prompt parameters
(and query for the customers that don't show), when that works, create
a blank form and throw a combo box=name on it. Make that work. Then,
put an address combo box on the form and see if you can get it to work
there. BTW, did you confirm that you are able to get the customers to
appear in a simple query? If you can, then build your framework bit by
bit.

Also, is it always the same customers that don't show? There might be
something there.

It's something that, if we could see the form and data in action, I
believe we'd catch the error quickly. Debugging this thru the newsgroup
is difficult.

In a case like this, I usually use debug.print to get the current SQL
string used to find the record. Then I create a query of that sql.
Then see if I can find the record. To debug this she'll need to do it
one step at a time. All of a sudden, Voila, she'll spot the error.
Apr 1 '06 #9
Your code will not work if the customer name has an apostrophe in it.
Also check to be sure that the bound column of Combo32 has what you're
looking for in it. You might want to consider using Combo32.Text
rather than a raw reference to Combo32 as part of your search criteria
since [Combo32] will return the value of the bound column, not
necessarily what displays in the control on the form.

HTH,
Bruce

Apr 3 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9373
by: B | last post by:
I know there are several ways to speed up combo boxes and form loading. Most of the solutions leave rowsource of the combo box blank and set the rowsource to a saved query or an SQL with a where clause after users typed in one or several letters/digits. My problem is as follows Most of the time I need to display form in continuous format, that means the combo box will appear in each record. For example I have a form to let users view...
5
2385
by: Dalan | last post by:
I have been searching the archives in an effort to discover how to derive a dual use of a single combo box - so far no go. I found the piece below which pretty much represents the usage. To summarize: The cboKeyword box on the frmCustomer looks up Keywords from a separate table that have just a list of keywords and a KeyID number. The bound column is tied to the autonumber and is saved in the frmCustomer table. The keywords appear in the...
1
3371
by: James | last post by:
I am used to VB6 but need to develop something in .Net. I need to create several bound combo-boxes which will use lookup tables to get their values. I created a form using the dataform wizard. As part of the setup, I specified a new dataset, which included the data & lookup tables. I also specified the relationships when required. I then added a combo box control to my form, following the instructions from
10
1915
by: Richard | last post by:
I have created a form which sets up a dataview. The form views one record at a time using a currencymanager. This works fine. All my text boxes bind. However I have a combo box which gets its lookup values from another (Advertising) table (AdvertisingID, Advertising). This works .. However, where it doesn't work as well is when the form loads, the combo boxes should bind to the AdvertisingID field and display the respective data.
1
4869
by: Bill | last post by:
Problem: Combo box data disappears from view when a requery is done See "Background" below for details on tables, forms & controls On a form, I want to use the setting of bound combo box C1 to limit what is displayed in bound combo box C2. When I display Tbl-A records on a continuous form, and navigate away from record 1 to record 2, the previously entered data displayed in C2 for record 1 disappears from
0
1997
by: northshore | last post by:
Hello, I am creating a windows application database. I have a primary table 'Individuals' and a lookup table 'Prefixes.' In the Individuals table, I have a column 'PrefixID' that references values of prefixes from the Prefix table based on the PrefixID in the Prefix table. When I load a windows application form, I can display and update data from the primary table. This includes the prefixID value. If I display a combo box with...
1
1663
by: andy | last post by:
I have three things, 1. a form with a combo box on it. 2. A lookup table with 2 fields, RMName and RMmrm. 3. A table with site information including an RM field and an MRM field. The combo box is getting its info from the lookup table but only the RMName is visible. I have the control source set to MRM so that when an RM name is selected the RMmrm (RM code) goes into the MRM field in my site table. What I need to do is when an RM...
2
1630
by: Ausclad | last post by:
How Would you implement this? I have an existing Access application that needs to be converted to .net I am restricted to use the existing database design. One of the areas is a timesheet data entry screen. The existing Access app writes to a table (tblTimesheetHours). In the data entry screen, the fields, like employee name, job, etc are bound to combo
4
2474
by: Karl | last post by:
Using A2000 with 2 tables Table 1 is a reference table with 2 fields Table 2 has 2 fields and 2 combo boxes to lookup date in table 1 Combo1 binds to col 1 in table 1, this works OK Combo 2 is set to bind to col 2 in table 1 but it always binds col 1 Column Count is set to 2 and I can see both columns in the dropdown Bound Column is set to 2
0
9705
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10564
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10073
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7609
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4288
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
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2981
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.