Hi all,
I am using the following piece of code to insert records into a table.Sometimes it is inserted at the bottom,sometime s at the middle and sometimes at top of the table.
[HTML]Private Sub Command383_Clic k()
Dim Db As Database
Dim rs As DAO.Recordset
Dim strsql As String
txtMessageTest = ""
Set Db = CurrentDb
Set rs = Db.OpenRecordse t("casedetails" , dbOpenDynaset)
rs.MoveLast
DoCmd.OpenForm "frmZoomTes t", , , , , acDialog
If Not txtMessageTest = "" Then
strsql = "insert into casedetails (casenumber,cas edetails,curren tuser) values(" & Val(Me!CaseNumb er) & ",'" & txtMessageTest & "','" & gfncCurrentUser & "')"
Db.Execute strsql
subCaseDetails. Requery
Else
MsgBox "cancel Selected"
End If
rs.Close
Set rs = Nothing
Set Db = Nothing[/HTML]
Need to know what should be done to insert records always at the last?
Thanks,
Bibek
I am using the following piece of code to insert records into a table.Sometimes it is inserted at the bottom,sometime s at the middle and sometimes at top of the table.
[HTML]Private Sub Command383_Clic k()
Dim Db As Database
Dim rs As DAO.Recordset
Dim strsql As String
txtMessageTest = ""
Set Db = CurrentDb
Set rs = Db.OpenRecordse t("casedetails" , dbOpenDynaset)
rs.MoveLast
DoCmd.OpenForm "frmZoomTes t", , , , , acDialog
If Not txtMessageTest = "" Then
strsql = "insert into casedetails (casenumber,cas edetails,curren tuser) values(" & Val(Me!CaseNumb er) & ",'" & txtMessageTest & "','" & gfncCurrentUser & "')"
Db.Execute strsql
subCaseDetails. Requery
Else
MsgBox "cancel Selected"
End If
rs.Close
Set rs = Nothing
Set Db = Nothing[/HTML]
Need to know what should be done to insert records always at the last?
Thanks,
Bibek
Comment