Problem with a form data result

R

RayVac

I have a data base on MSAccess 2000 in which i have a table with a field
format numeric that represent the customer number.
When i search directly in my table for a specific customer number; all work
fine and i get the information. When i use a query attached to this table
and that have a criteria as ( [Type in customer number]; all work fine too i
get allways the information i need. But when i use my form; i never able to
obtain my information whenever i use the same request as data source. I
receive the message that no data correspond to my request.
 
A

Al Camp

Ray,
You wrote...
But when i use my form; i never able to obtain my information...
It would have been helpful had you described how you're doing that on
your form...

Without any details, I can only suggest trying Val(YourSearchData).
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

RayVac said:
I have a data base on MSAccess 2000 in which i have a table with a field
format numeric that represent the customer number.
When i search directly in my table for a specific customer number; all
work
fine and i get the information. When i use a query attached to this table
and that have a criteria as ( [Type in customer number]; all work fine too
i
get allways the information i need. But when i use my form; i never able
to
obtain my information whenever i use the same request as data source. I
receive the message that no data correspond to my request.
 
G

Guest

I'm not clear just how you want the form to operate, but I guess you want a
control on a bound form to take you to the selected record in the form's
underlying recordset. I'd suggest having an unbound combo box on the form
with a RowSource property such as:

SELECT CustomerNumber
FROM Customers
ORDER BY CustomerNumber;

In its AfterUpdate event procedure put:

Dim rst As Object

Set rst = Me.Recordset.Clone

rst.FindFirst "CuctomerNumber = " & cboFindCustomer
Me.Bookmark = rst.Bookmark

This assumes CustomerNumber is a number data type, not text. As this code
navigates to the first matching record, if the form is based on a table which
has multiple rows per customer, e.g. an Orders table, then you should sort
the form's data by customer number, so that the records per customer are
grouped together, by basing it on a query such as:

SELECT *
FROM Orders
ORDER By CustomerNumber, OrderDate;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top