John Vinson's
Private Sub BUTTON1_Click()
Dim strSQL As String
On Error GoTo Proc_Err
strSQL = "INSERT INTO mytablename (FIELD1, FIELD2, FIELD3, FIELD4) " _
& "VALUES(""" & Me!TEXTBOX1 & """, """ & Me!TEXTBOX2 & _
""", """ & Me!TEXTBOX3 & """, """ & Me!TEXTBOX4 & """);"
Currentdb.Execute strSQL, dbFailOnError
Proc_Exit:
Exit Sub
Proc_Err:
MsgBox "Error " & Err.Number & " in BUTTON1_Click" & vbCrLf & Err.Description
Resume Proc_Exit
End Sub
DID IT!!!
--
Thanx & Best Regards,
Faraz!
"Faraz Ahmed Qureshi" wrote:
> Could someone pls provide a sample code for BUTTON1 on FORM1 which onclick
> adds the entries in TEXTBOX1, TEXTBOX2, TEXTBOX3, TEXTBOX4 to TABLE1's
> FIELD1, FIELD2, FIELD3 & FIELD4?
> --
> Thanx & Best Regards,
>
> Faraz!
|