473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to view data by using the next button

Hi,
i am using acees 2007 with vb.
i have records stord there and i want to view them through my application by the next and previous buttons, but when i press the next button it will not move to the other record.

below is the code;
this is for the next button
Expand|Select|Wrap|Line Numbers
  1. Private Sub nextcmd_Click()
  2. If rs.RecordCount > 0 Then
  3.         rs.MoveNext
  4.         If (Not rs.EOF) Then
  5.  
  6.             Prevcmd.Enabled = True
  7.             fill_data
  8.         Else
  9.             nextcmd.Enabled = False
  10.             Prevcmd.Enabled = True
  11.             fill_data
  12.         End If
  13.     End If
  14. End Sub
  15.  
Expand|Select|Wrap|Line Numbers
  1. Private Sub fill_data()
  2.  
  3. If rs.BOF Or rs.EOF Then txtserial.Locked = True
  4.  
  5. 'txtdate.Locked = True
  6. txtserial.Locked = True
  7. txtname.Locked = True
  8. txtcpr.Locked = True
  9. txtphone.Locked = True
  10. cmddesc.Locked = True
  11. cmdprice.Locked = True
  12. txtcomments.Locked = True
  13. 'txtcashier.Locked = True
  14. cmdtype.Locked = True
  15. 'txtdate.Locked = True
  16.  
  17. Set cn = New ADODB.Connection
  18.  
  19.     cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  20.         "Data Source=C:\Users\nooras\Desktop\revenue\rev system\LoginExample\Users.mdb;"
  21.  
  22.     '~~> Open a recordset
  23.     Set rs = New ADODB.Recordset
  24.     '~~> Open the recordset
  25.     rs.Open "SELECT * FROM  Table2", cn, , , adCmdText
  26.  
  27. txtserial = rs!serial
  28. txtname = rs!customername
  29. txtcpr = rs!cpr
  30. txtphone = rs!phonenumber
  31. cmddesc = rs!Description
  32. cmdprice = rs!payment
  33. txtcomments = rs!Comments
  34. 'txtcashier = rs!cashier
  35. cmdtype = rs!paymenttype
  36.  
  37. 'txtNo = rs!ViewNo
  38.  
  39. 'txtname = rs!Name
  40. 'txtcpr = rs!cpr
  41. 'txtdate = rs!Date
  42. txtserial = ""
  43. txtname = ""
  44. txtcpr = ""
  45. txtphone = ""
  46. cmddesc = ""
  47. cmdprice = ""
  48. txtcomments = ""
  49. 'txtcashier = rs!cashier
  50. cmdtype = ""
  51.  
  52. 'txtNo = ""
  53.   '  txtname = ""
  54.   '  txtcpr = ""
  55.   '  txtdate = ""
  56.  
  57. Else
  58.  If IsNull(rs!serial) Then txtserial = "" Else txtserial = rs!serial
  59.      If IsNull(rs!customername) Then txtname = "" Else txtname = rs!customername
  60.     If IsNull(rs!cpr) Then txtcpr = "" Else txtcpr = rs!cpr
  61.       If IsNull(rs!phonenumber) Then txtphone = "" Else txtphone = rs!phonenumber
  62.         If IsNull(rs!Description) Then cmddesc = "" Else cmddesc = rs!descreption
  63.       If IsNull(rs!payment) Then cmdprice = "" Else cmdprice = rs!payment
  64.  
  65.  
  66.     'If IsNull(rs!Date) Then txtdate = "" Else txtdate = rs!Date
  67.  
  68. End If
  69.  
  70. txtserial.Locked = True
  71. txtname.Locked = True
  72. txtcpr.Locked = True
  73. txtphone.Locked = True
  74. cmddesc.Locked = True
  75. cmdprice.Locked = True
  76. txtcomments.Locked = True
  77. 'txtcashier.Locked = True
  78. cmdtype.Locked = True
  79. 'txtdate.Locked = True
  80.  
  81. End Sub
  82.  
Thankx
Dec 22 '10 #1
0 897

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ABinBoston | last post by:
I have a form in a .adp with some values on it that are derived from a lookup I would like to click a Command Button and Add the Data in the textboxes to a Table the form is named...
2
by: Arsalan Ahmad | last post by:
Hi, May be I am a newbie, or may be i dont have that much insight in following systems ..i.e. why i have some confusions as below: In many websites, when search is performed on some keywords...
7
by: BillE | last post by:
What is the best way to add data using a DataGridView in a multi-tier application (data entry is handled in a data access layer using stored procedures)? Thanks Bill
2
slapshock
by: slapshock | last post by:
hi!!!! i am new in vb.net... i want to know how to add, delete, search and view data using vb.net.... please help me on how to do it... hope you can help me ...
22
AccessIdiot
by: AccessIdiot | last post by:
Anyone getting sick of me yet? :D I have a button on my form that opens a new form but with a filter: stDocName = "frm_Specimen_Entrainment" stLinkCriteria = "=" & Me! ...
1
by: Ruby jain | last post by:
pleade help me in coding of next buuton .how the data move when press the next button in c#
8
by: =?Utf-8?B?VGFtbXkgTmVqYWRpYW4=?= | last post by:
I am working with Visual C# window and in my application I need to use a button ( NEXT) . The button should displays one panel with its objects each time it clicked. I already developed the codes...
1
by: rjlorenzo | last post by:
Good Day, I just need help on my programming. I would like to try to retrieved/edit the data i've save using radio button and want it to displayed on radio button for editing or changing the...
4
by: bommanaboyina | last post by:
iam using textbox1,textbox2,textbox3 for Empid,Ename,Esalary and iam upadting the data using update button for that im using stored procedure for updating ename esalary and the problem is some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.