Private Sub Save_Click()
Dim strSQL As String
Dim admSQL As String
intTOnr = "0001"
admSQL = "Select [TO],[Date],[TO_number] from [Table1]"
With CurrentDb.OpenRecordset(admSQL)
admSQL = "insert into [Table1] ([TO],[Date],[TO_number]) values ('" & Me.TONumber & "', '" & Me.DateCreated & "', " & intTOnr & ")"
If Not .BOF Then
DoCmd.RunSQL admSQL
End If
End With
strSQL = "Select [Exmpl] from [Table2]"
With CurrentDb.OpenRecordset(strSQL)
strSQL = "insert into [Table2] values ('" & Me.TOType & "')"
DoCmd.RunSQL strSQL
End With
|