Find Record

amavadia

Registered User.
Local time
Today, 04:59
Joined
Mar 30, 2006
Messages
36
Hi, i am a beginner to access and need some help if someone would be kind enough...
i have a table (tblCustomer) which has all the standard customer details such as name, address, phone etc. The primary key of the table is a autonumber field (Customer ID). i have autoformed it so all the fields are now on a blank form. I want to add a text box to the form so that i can find a record by typing the customer's surname. Once this has been searched, i would like the records to be listed in a table in a subform further down the original form. I would then like the user to select the correct record they are looking for from the sub form, and the details to come up in the main form so they can be edited. The reason for the whole sub form part is because there may be more than one customer with the same surname.
please could someone suggest how to achieve this.

thanks
 
I don't understand what you mean by this;

i have autoformed it

Using the wizard put a combo box in the form header. When the wizard starts select option 3 (Find a record on my form etc...). Make sure that you choose enough fields to identify the customer ( e.g Surname, First Name Street etc).

You can also combine some fields, look this up in Help;

Combine text, number, date, and time values
 
Hi Amavadia,

Here is a search mdb I refer to when doing what your wanting to do.

Hope it helps, good luck with it.;)

Robert88
 

Attachments

Robert88

Thanks for posting that file, but can you explain how it works please. It also seems quite complicated and i do not need all the date selections before searching, just so that the user types in the surname and it searches a table, and brings up the details in a subform.

Thanks
 
Hi Amavadia

Any chance of posting an empty table of the field you are searching?

Robert88
 
Hope this is what you wanted?

Hi Amavadia,

I grabbed the table from your other posting and changed it accoding to the SamplSearch2003.zip file above. the remodelled mdb is attached.

SampleSearch2003.zip did have a lot of unneeded info in it, maybe you might be able to make heads and tails of this zip easier considering it only has Surname as a search field on the Form Form1.

I hope this helps. For code check "ON LOAD" of form, "ON CLICK" of search button. In addition the query created to do this as well as the subform.

Good Luck with it, if you have any questions do not hesitate to ask, sorry for taking so long to get back. I Had a magnificent weekend in Melbourne, especially watching the Formula 1 races that finished here yesterday.:p

All the best

Robert88
 

Attachments

Last edited:
thanks robert, thats exactly what i wanted
is there a way of selecting the correct customer in the subform and all their details get filled in the main form automatically?
 
Hi Amavdia,

Just thinking out a loud, maybe include a field yes/no (say no as default) in the fields amongst your subform. In order to select your subform customer then switch your default "no" to "yes" maybe using a box to tick.

I suppose with a little SQL select the "yes" field, giving you access then to all fields in this recordset which with maybe the push of a button would give you the results of this find back to the main form.

Robert88
 

Users who are viewing this thread

Back
Top Bottom