I cannot seem to get this portion of code to work:
Dim StrSQL As String
Dim StudName As String
StudName = Me.StudentName
StrSQL = "INSERT INTO Attend (StudentName) " & "SELECT " & StudName & ";"
DoCmd.RunSQL StrSQL
Where "StudentName" is the field name with data type "text" in the table "Attend". When I type a name into the textbox "StudentName", and I run the code, a pop up asks me for a paramater value.
However, the code below works find if the items I am inserting into the table Attend are numbers or dates. For example:
Dim StrSQL As String
Dim StudNumber As Long
StudNumber = Me.StudentNumber
StrSQL = "INSERT INTO Attend (StudentNumber) " & "SELECT " & StudNumber & ";"
DoCmd.RunSQL StrSQL
works perfectly when I type a number in the text box "StudentNumber."
What am I missing? Thanks.
Dim StrSQL As String
Dim StudName As String
StudName = Me.StudentName
StrSQL = "INSERT INTO Attend (StudentName) " & "SELECT " & StudName & ";"
DoCmd.RunSQL StrSQL
Where "StudentName" is the field name with data type "text" in the table "Attend". When I type a name into the textbox "StudentName", and I run the code, a pop up asks me for a paramater value.
However, the code below works find if the items I am inserting into the table Attend are numbers or dates. For example:
Dim StrSQL As String
Dim StudNumber As Long
StudNumber = Me.StudentNumber
StrSQL = "INSERT INTO Attend (StudentNumber) " & "SELECT " & StudNumber & ";"
DoCmd.RunSQL StrSQL
works perfectly when I type a number in the text box "StudentNumber."
What am I missing? Thanks.