A10Instructor
Technical User
All,
Been looking through the help files, books and these forums and can't find an answer to my question/need (or I'm too dense and missed them altogether).
I have a form that the user selects data from combo boxes. When the user clicks the 'Continue' button, this data is added to table "test1". Thanks to TheAceMan1's help, this part is working great.
I now wish (and can't figure out) for the continue button to pop up a form asking how many students are in the class. Next, a form is generated, that contains text boxes for "Rank, Firstname, MI, Lastname, and Suffix" and then transfer this data to an associated table called 'student info'.
For example: 'continue' is clicked, form appears stating "How many students are in the class?" User enters 4. Now a new form appears with four lines of textboxes asking for rank, firstname, MI, lastname, and suffix. When data entry is completed, info is saved to student info table for printing onto a certificate using a report when print certificates is selected. Then delete the records of table 'student info' when printing is done.
I have the form 'class size' and table 'student info' created. Here is the code for the 'continue' button which kicks the whole chain of events off:
Is this possible to do? Or am I asking for too much? Any clues/suggestions?
Thanks
A10 Instructor
"The World is My Classroom
Been looking through the help files, books and these forums and can't find an answer to my question/need (or I'm too dense and missed them altogether).
I have a form that the user selects data from combo boxes. When the user clicks the 'Continue' button, this data is added to table "test1". Thanks to TheAceMan1's help, this part is working great.
I now wish (and can't figure out) for the continue button to pop up a form asking how many students are in the class. Next, a form is generated, that contains text boxes for "Rank, Firstname, MI, Lastname, and Suffix" and then transfer this data to an associated table called 'student info'.
For example: 'continue' is clicked, form appears stating "How many students are in the class?" User enters 4. Now a new form appears with four lines of textboxes asking for rank, firstname, MI, lastname, and suffix. When data entry is completed, info is saved to student info table for printing onto a certificate using a report when print certificates is selected. Then delete the records of table 'student info' when printing is done.
I have the form 'class size' and table 'student info' created. Here is the code for the 'continue' button which kicks the whole chain of events off:
Code:
Private Sub continue_button_Click()
On Error GoTo Err_continue_button_Click
Dim SQL As String
SQL = "INSERT INTO test1 (crscode, " & _
"crsname, pdscode, " & _
"crshours, ccafhours, " & _
"squadron, detnumber, " & _
"baseloc, state_country, " & _
"first, MI, last, " & _
"suffix, rank, branch, position, " & _
"graddate) " & _
"Values (Forms!test!txtcrscode, " & _
"Forms!test!txtcrsname, Forms!test!txtpdscode, " & _
"Val(Forms!test!txtcrshours), Val(Forms!test!txtccafhours), " & _
"Forms!test!txtsquadron, Forms!test!txtdetnumber, " & _
"Forms!test!txtbase, Forms!test!txtstate_country, " & _
"Forms!test!txtfirst, Forms!test!txtMI, Forms!test!txtlast, " & _
"Forms!test!txtsuffix, Forms!test!txtrank, Forms!test!txtbranch, Forms!test!txtduty_position, " & _
"Forms!test!txtgraddate);"
DoCmd.RunSQL SQL
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "class size"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_continue_button_Click:
Exit Sub
Err_continue_button_Click:
MsgBox Err.Description
Resume Exit_continue_button_Click
End Sub
Is this possible to do? Or am I asking for too much? Any clues/suggestions?
Thanks
A10 Instructor
"The World is My Classroom