Insert/Append Data to a Table

diensatthan

Registered User.
Local time
Today, 14:43
Joined
Apr 27, 2003
Messages
14
Please Help.

I'd like a click procedure to copy data from 3 unbounded Text Boxes (txtNum, txtText, and txtDate) on a form, to the corresponding fields TempQty, TempTxt, and TempDate in Table tblTemp. Table tblTemp was created and is empty. Thanks.

Also, thanks to ChrisO and Mile-O-Phile for their help with my other questions.
 
I'm kinda new to Access, but you could put a DoCmd.RunSQL in an OnClick Event Procedure attached to your button. I actually am working on a db that will move records from one table to another on the click of a button. But in your case, you would just take the values of the text boxes and assign them to variables. Here's my sample. Anyone here can correct me...
Code:
            response = MsgBox("Are you sure you want to commit these records?", 36, "Commit Records")
                If response = vbYes Then
                    DoCmd.RunSQL "INSERT INTO [Committed Data] (ssn, amount, CommitDate, CommitUser) _
                    SELECT ssn, amount, date(), currentuser FROM [Pending Data]"
                    DoCmd.RunSQL "DELETE * FROM [Pending Data]"
                    MsgBox "Record(s) successfully committed.", 64, "Commit Records"
                    DoCmd.Close
                    DoCmd.OpenForm "Detail"
                End If
            Else
                DoCmd.CancelEvent
        End If
 
I got it working. Thanks.
 

Users who are viewing this thread

Back
Top Bottom