Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding sql to forms

Status
Not open for further replies.

shanewa

Technical User
Dec 10, 2001
13
US
I was given this sql code to add to a form so that the text and combo boxes would be inserted into the tables. but I do not even no where to begin or if the code is any good.

Dim strNewRecord As String
Dim strSQL As String
Dim rst As Recordset
Dim dbs As Database
Set dbs = CurrentDb

DoCmd.RunSQL "insert into Fork values(Me![gserial],me![cmbtype])"
'Set rst = dbs.OpenRecordset(strNewRecord)


DoCmd.RunSQL "insert into fork_2 values(Me![ssn],me![tageqid],me![issuedate],me![updated])"
DoCmd.SetWarnings False
DoCmd.SetWarnings True


DoCmd.GoToRecord , , acPrevious
Me.Refresh



 
what is it you are trying to do? Dave
ToeShot@Hotmail.com
Today Is Tomorrows Yesterday. So Why Wait
 
I have a form whose source is a table. I also have several more text boxes on the form whose source is another table. I would like to add information from this form as a new record to these two forms.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top