467,202 Members | 1,097 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,202 developers. It's quick & easy.

Auto number after a look up

I want to set a auto number but the first 3 digits should be picked
from a value of another table like for example a customer no is 999
i want the Pet no of this customer to be 999/(Autonumber)

i can i get this done

what i want is no user input in this field

user will select the customer from the otrher table which give the
first 3 digits and the auto number should come on it own
any help wil be apprecisted.
Regds
Vikas
vi*******@hotmail.com
Nov 12 '05 #1
  • viewed: 1211
Share:
2 Replies
DFS
Vika,

You identified the problem and the solution yourself, haven't you?

You'll probably have to add this derived ID to the table via a form. On the
AfterInsert event of the form, or at the end of whatever code fires when a
customer is selected, issue a command like this:

Me.DerivedID = Left(CustNbr,3) & "/" & me.AutoNumberField

In your example, the use of a forward slash dictates that DerivedID be a
text field.

Let me add this question: is there really a need for you to use the 1st
three digits of the customer number plus "/" and a unique ID? That process
will just build a second unique ID. You're probably better off using the
original AutoNumber, and storing the entire Customer Number. If those 3
digits are meaningful, you'll still have them for sorting and querying, etc.


"Vikaspell" <vi*******@yahoo.com> wrote in message
news:b7**************************@posting.google.c om...
I want to set a auto number but the first 3 digits should be picked
from a value of another table like for example a customer no is 999
i want the Pet no of this customer to be 999/(Autonumber)

i can i get this done

what i want is no user input in this field

user will select the customer from the otrher table which give the
first 3 digits and the auto number should come on it own
any help wil be apprecisted.
Regds
Vikas
vi*******@hotmail.com

Nov 12 '05 #2
tblCustomer
customerId autonumber (Pk)

tblPet
customerId long number (Pk)
petId autonumber (Pk)

qryPet
select customerId & petId as petNo from tblPet

vi*******@yahoo.com (Vikaspell) wrote in message news:<b7**************************@posting.google. com>...
I want to set a auto number but the first 3 digits should be picked
from a value of another table like for example a customer no is 999
i want the Pet no of this customer to be 999/(Autonumber)

i can i get this done

what i want is no user input in this field

user will select the customer from the otrher table which give the
first 3 digits and the auto number should come on it own
any help wil be apprecisted.
Regds
Vikas
vi*******@hotmail.com

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Larry Rekow | last post: by
11 posts views Thread by csomberg@dwr.com | last post: by
8 posts views Thread by Prometheus Research | last post: by
4 posts views Thread by Shahar | last post: by
13 posts views Thread by S.Dickson@shos.co.uk | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.