Hi all,
I'm new to VBA, but have been working with VB for sometime now. I have a very basic question that I would have no trouble with in VB.Net, but here it goes. I am trying to insert data from a form that I made into a table in the database. I've made the query for the insert with all of the parameters outlined. WHen I press the submit button I want it to send the corresponding text box values to the query, so it will add to the table. The only problem is I really am having some troubles. This is as far as I could go

VB Code:
  1. Dim db As Database
  2. Dim qry As QueryDef
  3. Const strQueryName = "Camp_Create_InsertInto_Student_Info"
  4. Set db = CurrentDb()
  5. qry.Parameters("@Student_Fname") = FirstName.Value
  6. qry.Parameters("@Student_Lname") = LastName.Value
  7. qry.Parameters("@Student_Age") = Age.Value
  8. qry.Parameters("@Student_DOB") = DOB.Value
  9. qry.Parameters("@Student_GardianName") = Gardian.Value
  10. qry.Parameters("@Student_Address") = Address.Value
  11. qry.Parameters("@Student_Apt") = Apt.Value
  12. qry.Parameters("@Student_City") = City1.Value
  13. qry.Parameters("@Student_State") = State.Value
  14. qry.Parameters("@Student_Zip") = Zip.Value
  15. qry.Parameters("@Student_HomePhone") = Phone.Value
  16. qry.Close
  17. db.Close

It gave me problems. This code is in the onClick event procedure for the button on the form. I'm very lost and could really use some help with this simple but important part of developing something within Access. Please help.

Cran56