Query to Create Record with next Autonumber

absolutered03

Registered User.
Local time
Today, 03:49
Joined
Nov 11, 2008
Messages
17
Hi Guys,

I have a situation with which I would love some assistance, if possible.

TblCalls
CallID
CallDate
RepName

TblAnswers
AnswerID
CallID
QuestionID
AnswerValueID

I have two forms:
frmCalls
txtCallDate
txtRepname
memoNotes
subfrmAnswers

I wrote a query which populates a set of 40 questions from my tblQuestions, by QuestionID, into tblAnswer for the current CallID being worked on in the frmCalls.

I need this query to run every time a new record is created (so, not when navigating created records)

My problem is, it can populate the questions, but I cannot get it to populate the next CallID that is created with the new record for the main tblCalls.

Is there a way to do this?
 
Last edited:
Populate the ID WHERE exactly? in a form? If you need to do it in a form, just use a little bit of code with a DMAX() + 1 type of functionality to get a new ID.
 
the append query needs to take the new CallID as a parameter so it can use it to populate the foreign key in the appended records.

Open the append query in design view. in the Field cell for the callID, put a reference to the form field:
Forms!yourformname!CallID
 

Users who are viewing this thread

Back
Top Bottom