Loop through records, pop up window for data and insert

  • Thread starter steamngn via AccessMonster.com
  • Start date
S

steamngn via AccessMonster.com

Hi All!
Is it possible to loop through records and pop up a window for additional
data, then insert the record? at present I have this:
Dim SQLStr As String
If MySelected2 <> "" Then
SQLStr = "INSERT INTO ATTENDANCE (ATT_HDR_ID,STUDENT_ID,EVENT_ID,LOCATION_ID,
EVENT_DAT,COMMENT,PHYSICAL_LIMITS,EVENT_FEE) SELECT " & Forms!ATTENDANCE_HDR.
ATT_HDR_ID & " as ATT_HDR_ID, STUDENTS.STUDENT_ID AS STUDENT_ID," & Forms!
ATTENDANCE_HDR.EVENT_ID & " as EVENT_ID," & Forms!ATTENDANCE_HDR.LOCATION_ID
& " AS LOCATION_ID,'" & Forms!ATTENDANCE_HDR.EVENT_DAT & "' as EVENT_DAT, '',
'',0 FROM STUDENTS WHERE STUDENT_ID IN (" & MySelected2 & ")"
DoCmd.SetWarnings False
DoCmd.RunSQL (SQLStr)
DoCmd.SetWarnings True
Set colCheckBox = Nothing
Me.Requery
Forms!ATTENDANCE_HDR!sfmstudentclasslist.Requery
End If
inserting records just fine. But some of our classes require fees, and I
would like to pop up a small form to add the amount (different for each
student) and then insert each record.
Yes? No? better ideas?
Thank you
Andy
 
B

Boyd Trimmell aka HiTechCoach via AccessMonster.co

Yes, is is possible to do what you want. Your code does not seen to the
complete code for the event/sub/function.

Where is this code?

What is "MySelected2"?

How will you know what recordset to loop through?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top