Link to home
Create AccountLog in
Avatar of Frank Freese
Frank FreeseFlag for United States of America

asked on

Updating using recordset code

Experts,
I've been using INSERT INTO to save a record at times. I recently had an expert make this comment:
"In this thread, the sql string in the accepted solution is actually syntactically incorrect, so its not clear whether you corrected it (or how), or whether you opted to go with the recordset method suggested in that comment.
Using recordset code is a great way to handle data inserts and updates from forms, which can make for convoluted SQL statements.  The recordset code tends to be easier to follow and easier to maintain/expand."

I've run into another situation that I can use the INSERT INTO statement as follows:
sqlSave = "INSERT INTO tblBonusStoreParticipants(PreliminaryBonusID,EmployeeID)
 VALUES(" & Me.PreliminayBonusID & "," & Me.StoreID.Column(7) & ")"
CurrentDb.Execute strDM, 128

Open in new window

I would like to learn how to use recordset code rather that INSERT INTO
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Frank Freese

ASKER

looks rather simple and is easier to follow. Would this be better than using the INSERT INTO?
for one, you don't have to worry about single quotes {'} and Double Quotes {"}  and formatting your SQL statement.

Expert simplified a process for me and was clear in his responses. Thanks capricorn - much appreciated - good job