saleemMSMS
Registered User.
- Local time
- Today, 21:44
- Joined
- Aug 12, 2009
- Messages
- 92
consider the following tables
i have 2 interfaces for the above 2 tables.
the training attendance is a subform of the training program form.
and the form looks like follows
the training sesssion sub form saves data as follows.
(i.e the sesion id starts again from 1 for a new program id)
in the interface, entering of sessionID should be done manually. so in order to make it somewhat automated, i wrote the following query
this is saved in the query named TrainingSessionIncrement and this works well if run individually. but when i included it into the double click event of trainingSessionID text box,
the following error occurs.
Run-Time Error'3061'
Too Few Parameters. Expected 1.
what shall i do ? please correct me.

i have 2 interfaces for the above 2 tables.
the training attendance is a subform of the training program form.
and the form looks like follows

the training sesssion sub form saves data as follows.
(i.e the sesion id starts again from 1 for a new program id)

in the interface, entering of sessionID should be done manually. so in order to make it somewhat automated, i wrote the following query
Code:
select max(sessionID)+1
from trainingProgram inner join trainingSessions on
trainingProgram.programID=trainingSessions.programID
where programID=forms!trainingProgram!programID
this is saved in the query named TrainingSessionIncrement and this works well if run individually. but when i included it into the double click event of trainingSessionID text box,
Code:
Private Sub TrainingSessionID_DblClick(Cancel As Integer)
forms!trainingProgram!programID.setfocus
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("TrainingSessionIncrement") 'this is the queryName
TrainingSessionID.Text = rs(0)
rs.Close
Set rs = Nothing
End Sub
the following error occurs.
Run-Time Error'3061'
Too Few Parameters. Expected 1.
what shall i do ? please correct me.