Solved

show set number of records??

Posted on 2002-03-17
1
157 Views
Last Modified: 2010-05-02
HI I am accessing a database like below how can show only 25 records per page

Dim search As String
Dim Lookin

Dim Name
   Dim Day As String
   Dim Address As String
   Dim Phone As String
   Dim Time As String
   Dim Scheduled_by As String
   Dim Company_Name As String
   Dim ID As String
   Dim myquery As String
   
Dim Field As String
Dim Searchcar As String
search = Request.Form("search")

search = Request.Form("search")
Lookin = Request.Form("lookin")
Field = Lookin
Searchcar = "LIKE"

'myquery = Field & " " & Searchcar & " '" & search & "'"
myquery = Field & " " & Searchcar & " '" & search & "'"
OpenConnection App.Path & "/apppointit.mdb"
   mRS.Open "SELECT * FROM appointment WHERE " & myquery & "", "" & mCN
  If mRS.EOF = True Then
  Response.Write "<b>No records found</b>"
  Exit Sub
  Else
    'While mRS.EOF <> True
 Do While Not mRS.EOF
 'For Each Colum In mRS.Fields
        ID = mRS.Fields("ID").Value
        Name = mRS.Fields("Name").Value
        Day = mRS.Fields("Date").Value
        Address = mRS.Fields("Address").Value
        Phone = mRS.Fields("Phone").Value
        Time = mRS.Fields("Time").Value
        Scheduled_by = mRS.Fields("Sceduler").Value
        Company_Name = mRS.Fields("Company").Value
   resronse.write "ID"
        mRS.MoveNext
       
        Loop
        mRS.Close
        Endit
0
Comment
Question by:hilltop
1 Comment
 
LVL 45

Accepted Solution

by:
aikimark earned 5 total points
ID: 6875684
Dim intRecsOnPage as Integer

Do While Not mRS.EOF
  intRecsOnPage = intRecsOnPage + 1



  If intRecsOnPage = 25 then
    intRecsOnPage = 0
    'Do End Of Page processing here
  End If

  mRS.Movenext

Loop
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question