This topic is locked
[SOLVED]

 Add page based on query

6/28/2005 9:04:04 AM
ASPRunnerPro General questions
jmisson author

Hi,
I am not sure if I am trying to achieve the impossible, but I have an add page, that a user can access directly from the menu.
This add page is a query that links two tables tblCustomer and tblEnquiry
CustomerFK is the foreign key that links tblEnquiry to tblCustomer
When a user adds a new enquiry and a corresponding new customer the CustomerFK is added to the database as a zero in tblEnquiry, but the new customer is added to tblCustomer.
Is there a correct way to set this up so as the CustomerFK is filled in with the value of the CustomerID, without having to go via the list page.
Or am I expecting too much.
Regards
Julie

admin 6/30/2005

Julie,
you need to add CustomerFK and CustomerID fields to your query in Access.
After that open query_add.asp file and replace this code snippet
rs.Update

rs.Close
with this:

rs.Update

rs("CustomerFK")=rs("CustomerID")

rs.Update

rs.Close

jmisson author 7/6/2005

Many thanks - works great..
Julie