View Full Version : Help with autocomplete


Appollo14
03-17-2001, 05:29 PM
The problem

I have a simple DB that i would like to perform a little automation with, however I cant seem to get my head around it.

I have a form to allow records to be kept for purchase orders.
The from has a subform on which the actual details of the items are kept.
This is the bit that I would like automated (in part!)

This sub form uses 2 tables, Products and Order Items. The products table is a simple table that holds stock details.

It has;
ProductId = Autonumber & Primary key
ProdCode = Text
ProdDesc = Text
UnitPrice = Currency

The OrderItems table holds the information relating to items on the orders (The order head being stored in another table);

This contains;
ItemId = Autonumber & Primary Key
ProductId = Foriegn key from product table
**ProdDesc = Text
**UnitPrice = Currency
Qty = Numeric
The items marked ** are the items that I would like to be filled in automatically when I select the ProductId

I hope that I have given enough information for you to help.

Many thanks
Noel.

KevinM
03-19-2001, 06:41 AM
On your subform create a combo box that includes ProductID, Desc and UnitPrice from the PRODUCTS TABLE.

Bind it to ProductID field on the form

On the after update event of the combo put...

ProdDesc=ComboNmae.Column(1) ' Second col
UnitPrice=ComboName.Column(2) ' Third Col

That should 'autofill' the fields on your form.

HTH

Kevin M

Appollo14
03-19-2001, 12:12 PM
Kevin
You're a Diamond. I've been struggling with this for absolutely ages. I just wish that I had found this forum about 3 months ago when I first started this project, I'm sure that it would have saved me a lot of 'fumbling in the dark'.

Once again, many thanks.
Regards
Noel.

KevinM
03-19-2001, 03:59 PM
Also, check out....
http://www.helptalk.net/forums/access/

That's where I usually hang out