keskiviikko 29. elokuuta 2007

Howto INSERT from MS Access forms

' AutoNumber field is updated automatically if one exists
Private Sub Command1_Click()
Dim SQLI As String
SQLI = "INSERT INTO MYMOVIES ([GENRE],[NAME],[PRODUCTIONYEAR]) " & _

"values ('" & Forms!AddMovie!Genre & "'," & Forms!AddMovie!Name & _
"," & Forms!AddMovie!ProductionYear & "');"
DoCmd.RunSQL SQL_InsertFilm
Response = MsgBox("You added ' " & Forms!AddMovie!FilmName & " '.")
End Sub

Ei kommentteja: