Hye, I have problem with Auto Generate Slip No from Database.I wrote following code to get last record but it does not give me last record. Please help me?
Private Sub Command1_Click()
Module1.Connect
Dim rs As New ADODB.Recordset
Dim str As String
str = "SELECT Item_ID FROM Entry_Tab"
rs.CursorLocation = adUseClient
rs.Open str, conn, adOpenDynamic, adLockOptimistic
rs.MoveLast
Text1.Text = rs("Item_Id")
rs.Close
Module1.Disconnect
End Sub