A
Andy
Hi there,
I use a SQL statement to duplicate the record but I do not know how to
displace the new duplicate record immediately after run the SQL statement, I
can only view the duplicate record when I close the form and then open the
form again. I tried add the line "Me.Bookmark = LastModified" but not success.
Appreciate for your help! Thanks in advance!
Here is the code :
Private Sub Command25_Click()
strSql = "INSERT INTO [REQUEST SHEET DETAILS] ( [RS NO], [ITEM NO], QTY,
[UNIT PRICE] ) " & vbCrLf & _
"SELECT [REQUEST SHEET].[RS NO], [QUOTATION TABLE DETAILS].[ITEM NO],
[QUOTATION TABLE DETAILS].QTY, [QUOTATION TABLE DETAILS].[UNIT PRICE] " &
vbCrLf & _
"FROM [QUOTATION TABLE DETAILS] INNER JOIN [REQUEST SHEET] ON [QUOTATION
TABLE DETAILS].[QUOTATION NO] = [REQUEST SHEET].[QUOT NO] " & vbCrLf & _
"WHERE ((([QUOTATION TABLE DETAILS].[QUOTATION NO])='" & Me.[QUOT NO] & "'));"
DBEngine(0)(0).Execute strSql, dbFailOnError
End Sub
I use a SQL statement to duplicate the record but I do not know how to
displace the new duplicate record immediately after run the SQL statement, I
can only view the duplicate record when I close the form and then open the
form again. I tried add the line "Me.Bookmark = LastModified" but not success.
Appreciate for your help! Thanks in advance!
Here is the code :
Private Sub Command25_Click()
strSql = "INSERT INTO [REQUEST SHEET DETAILS] ( [RS NO], [ITEM NO], QTY,
[UNIT PRICE] ) " & vbCrLf & _
"SELECT [REQUEST SHEET].[RS NO], [QUOTATION TABLE DETAILS].[ITEM NO],
[QUOTATION TABLE DETAILS].QTY, [QUOTATION TABLE DETAILS].[UNIT PRICE] " &
vbCrLf & _
"FROM [QUOTATION TABLE DETAILS] INNER JOIN [REQUEST SHEET] ON [QUOTATION
TABLE DETAILS].[QUOTATION NO] = [REQUEST SHEET].[QUOT NO] " & vbCrLf & _
"WHERE ((([QUOTATION TABLE DETAILS].[QUOTATION NO])='" & Me.[QUOT NO] & "'));"
DBEngine(0)(0).Execute strSql, dbFailOnError
End Sub