View Full Version : Autonumbers and tables


DanF
04-30-2009, 04:21 PM
I'm trying to do a database which includes clients, work orders, and invoices.

Clients:

Client ID (Unique ID)
Name
Surname
Address
Tel
Mob
Date of 1st Service
Work Orders

Work Orders:

W/O number (Unique ID)
Details

At this point I'm lost. I want to create a form which lets me create a new Work Order. The form should give an AutoNumber to the W/O number and assign it to a client I want. Not sure what's the best way to do it though. Can I just have something to show me a list of my clients and search for the one I want to?

As soon as that is done, I'd like to store the W/O number together with details so that I can refer to it later if needed.

Is it possible?

Thanks.
Dan

pbaldy
04-30-2009, 04:27 PM
I would have a ClientID field in the work order table to identify which client it's for. On your work order form, I'd have a combo box that got its selections from the client table, but its control source is the ClientID field in the work order table.

jsv2002
04-30-2009, 04:35 PM
You need a foreign key in your work orders table so that any work orders generated can be linked to a customer.

An extract from a db I have done is attached but its just that.... should show you what you want if you study the structure :)

good luck John