Searching for record by multiple fields

carlisle

Registered User.
Local time
Today, 01:27
Joined
Aug 21, 2006
Messages
13
Hi,

Not sure where to put this, but as I want the information to be shown in form view, I guess this is the bext place to start.

In breif, I have created a database, in which infomation on machinery is held.

The problem I am having (atm), is I have to create a function, which I want to be presented in form form, where by each item can be searched by it's RequestID (unique) or the customer who owns it, so that its current location can be attached (or viewed).

I'm not sure whether i've worded this well, so to sumerise:

I need a form with 3 fields, RequestID, Customer and Location.

Where by I input the RequestID, which brings up the Customer and Location, or input Customer which brings up the RequestID and Location (obviously there will be mulitple results from Customer search).

Again, I hope I haven't confused anyone because it's pretty simple what i'm trying to say, but....

Thanks, Ben
 
One way can accomplish what you want

Create combo boxes in the form header section with the fields you want to search on, eg. cboRequestID and cboCustomer. The rowsource for cboRequestID is a query returning the RequestIDs. sorted. The rowsource of cboCustomer is query returning the Customers, sorted.

On the cboRequestID AfterUpdate event:
me!filter="ReuqestID=" & me!cborequestID
me!Filteron=true
me.requery

On the cboCustomer AfterUpdate event:
me!filer="Customer = '" & me!cboCustomer & "'"
me!Filteron=true
me.requery

Note: You should name fields using the commonly known "Hungarian Naming Convention" by which anyone can immediately determine the datatype of a field by its name.
 

Users who are viewing this thread

Back
Top Bottom