|
-
Mar 9th, 2008, 11:36 PM
#1
Thread Starter
Member
BOOKID not incrementing
I writing below code for incrementing Bookid... but it gives error
1) it is gives type conversion error
2) it is not incrementing when i wanted to add new records i.e. it display
B0001 only all the new records i adding...not incrementing
please help me with folllowing code
Private Sub LOADBOOKID()
On Error Resume Next
dim sr as integer
dim srplus as integer
Dim RSC As New RecordSet
RSC.Open “SELECT * FROM BOOKDETAILS”, Connect, adOpenStatic, adLockOptimistic
sr=RSC!BookID
srplus=SR+1
Txtbookid.Text= “B”&Format(srplus,”0000”)
RSC.Close
End Sub
Private Sub Form_Load()
LOADBOOKID
End sub
‘ add new book
Private Sub Command1_click()
LOADBOOKID
Dim RSCAs New Recordset
....
...
End sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|