473,471 Members | 4,687 Online
Bytes | Software Development & Data Engineering Community
Create 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 2281
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_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

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

Me!Combo32.Value = ""
End Sub

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

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

Me!Combo34.Value = ""
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_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

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

Me!Combo32.Value = ""
End Sub

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

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

Me!Combo34.Value = ""
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_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

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

Me!Combo32.Value = ""
End Sub

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

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

Me!Combo34.Value = ""
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
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...
5
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...
1
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....
10
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...
1
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...
0
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...
1
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...
2
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...
4
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...
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
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
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
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.