something wrong with this statetement, can

SamDeMan

Registered User.
Local time
Today, 16:58
Joined
Aug 22, 2005
Messages
182
strMySql = "INSERT INTO AgencyLogTbl (PricelistID, DateWorked, ShiftID)" & _
" SELECT Me!PriceListID AS Expr1, " & _
" Me!DateWorked AS Expr2, 12 As Expr3;"
rs2.Open strMySql, CurrentProject.Connection

something is wrong with this statement, i am new to ADO.

plz help!

thanks,

sam
 
thanks all - got my answer

got it from the groups on Microsoft. someone by the name "ofer" answered the following:

"INSERT INTO AgencyLogTbl ( PricelistID, DateWorked, ShiftID) VALUES (" &
Me!PriceListID & ", " & Me!DateWorked & ",12)"

it worked. thank you guys for looking. i don't understand the difference. never saw the values thing, but it works.

sam
 
For the record, the key wasn't the "VALUES" bit, though it's probably a better way to handle the insert of a single record. The key was concatenating the form references in, rather than them being included in the string as-is. In other words, not:

"SELECT Me.Whatever ..."

but:

"SELECT " & Me.Whatever & "..."
 

Users who are viewing this thread

Back
Top Bottom