Please help.... I have a form containing a subform.. Within my form I have 1 textbox (textbox1) and in my subform, 1 combo box (CB1) and a text box (TB2).. what I'm trying to do is On Click, add the info from textbox1, CB1 and TB2 to a new table called student_course information..
I have added the following code to the command button:
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim newclass As DAO.Database
Dim addclass As DAO.Recordset
Set newclass = CurrentDb()
Set addclass = newclass.OpenRecordset("Student_course Information")
addclass.AddNew
addclass!Student_Social_Security_Number = Me!Combo10
addclass!Course_ID = Me!Combo9
addclass!Course_Section = Me!Combo11
addclass.Update
addclass.Close
Set addclass = Nothing
Set newclass = Nothing
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub
When I test, I get the following error message:
"compile error: user-defined type not defined".. any ideas on how to solve this will be very appreciated, it's been a long time since I used access and now it's driving me crazy :-(..
Thank you.
I have added the following code to the command button:
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim newclass As DAO.Database
Dim addclass As DAO.Recordset
Set newclass = CurrentDb()
Set addclass = newclass.OpenRecordset("Student_course Information")
addclass.AddNew
addclass!Student_Social_Security_Number = Me!Combo10
addclass!Course_ID = Me!Combo9
addclass!Course_Section = Me!Combo11
addclass.Update
addclass.Close
Set addclass = Nothing
Set newclass = Nothing
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub
When I test, I get the following error message:
"compile error: user-defined type not defined".. any ideas on how to solve this will be very appreciated, it's been a long time since I used access and now it's driving me crazy :-(..
Thank you.