Simple Master Detail question

  • Thread starter Thread starter Tito Luyo Murata
  • Start date Start date
T

Tito Luyo Murata

Hi all:

I think this is a stupid question, but here it goes (sorry for my english)

I have a classic Orders / OrderDetails tables in Access ( I suppose is same
in SQL server ),
Orders table have an autonumeric field, called OrderID , which is primary
key,
when I create a record in Orders table, through an SQL-INSERT command,
Access automatically give this record the OrderID,
the question is :
how can I get this number, OrderID to use, to put in OrderDetails related
rows.

I hope can understand me :P

Thanks in advance
Greetings
Tito
 
See my article on handling identity issues. www.betav.com\articles.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Tito said:
Hi all:

I think this is a stupid question, but here it goes (sorry for my
english)

I have a classic Orders / OrderDetails tables in Access ( I suppose
is same in SQL server ),
Orders table have an autonumeric field, called OrderID , which is
primary key,
when I create a record in Orders table, through an SQL-INSERT command,
Access automatically give this record the OrderID,
the question is :
how can I get this number, OrderID to use, to put in OrderDetails
related rows.

I hope can understand me :P

Thanks in advance
Greetings
Tito

It's not a stupid question, it is a very common one. Look here:
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconRetrievingIdentityOrAutonumberValues.asp
 
Back
Top