By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 2,646 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Auto number after a look up

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.