Hard to explain -- two types of ItemID's one table

B

Brook

What I am doing is this:

I have a TabControl set up on my frmorders. Tab1 (Inhouse)
Tab2 (Custom) I want to be able to base this form on one
table, however, Inhouse orders are to have an Autonumber
id of NW-0000 and the Custom orders are to have an
Autonumber of KI-0000.

I understand that one table cannot have more than 1
Autonumber field, so does anyone have any suggestions on
how I can accomplish what I would like to do?

Please let me know if you don't understand or need more
information.

Thanks in advance,

Brook
 
P

PC Datasheet

Brook,

First, you can't have an autonumber of NW-0000 or KI-0000. Autonumber is a Long
data type and both of these are text. You need to have an OrderID field
(autonumber) and an OrderNum field for NW-0000 and KI-0000. You can consider
having an OrderType field (In-House or Custom) or just go by the two letter
prefix of the OrderNum field to determine the type of order. You would let
Access assign OrderID to each new record and not worry whether a new record is
created on Tab1 or Tab2.
 
B

Brook

Thanks for the information!

I have it set up to for "NW-"0000 for my FORMAT on my
autonumber and it will assign: NW-0001, NW-0002, etc.

Does this help?

Brook
 
H

Harold

Suggest you use OrderNum and OrderType Fields. To assign an order# to a new
inhouse order:
Me!OrderNum = DMax("[OrderNum]","TblOrders","[OrderType] = 'In-House'") + 1
To assign an order# to a new custom order:
Me!OrderNum = DMax("[OrderNum]","TblOrders","[OrderType] = 'Custom") + 1

Steve
PC Datasheet
 

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