Solved

ADO Field Record Count...

Posted on 2000-03-14
4
258 Views
Last Modified: 2008-03-17
Please can I have advised from the VB experts. Many Thanks!

I had a MS Access database with a 'updateRecord' field.

This 'updateRecord' field had a value of TRUE and FALSE.

How then can I do a count of knowing how many TRUE and FALSE records in the 'updateRecord' field.

Below is my coding...


Private Sub cmdUpdatPrice_Click()
   
    'Read Microsoft Access Updating File
   
    DiskFile = App.Path & "\sisTest3.mdb"
   
    On Error GoTo DatabaseAccessError:
   
    adosql.Refresh
    adoaccess.Refresh
   
    'adoaccess.Recordset.RecordCount
   
    Label1.Caption = adoaccess.Recordset.RecordCount
   
   
    Do While Not adoaccess.Recordset.EOF
       
        adosql.Recordset.MoveFirst
        adosql.Recordset.Find "ProductNo='" & adoaccess.Recordset.Fields("ProductNo") & "'"
       
        If Not adosql.Recordset.EOF Then
   
           adosql.Recordset.Fields("updateRecord") = True
       
           
           adoaccess.Recordset.Fields("updateRecord") = True
                       
   
           adoaccess.Recordset.Update
   
           adosql.Recordset.Update
           
   
           
           adoTableName.RecordSource = "[" & adosql.Recordset.Fields("TableName") & "]"
           adoTableName.Refresh
           adoTableName.Recordset.Find "ProductNo='" & adoaccess.Recordset.Fields("ProductNo") & "'"
           
           adoTableName.Recordset.Fields("DealerPrice1") = adoaccess.Recordset.Fields("DealerPrice1")
           adoTableName.Recordset.Fields("ListPrice1") = adoaccess.Recordset.Fields("ListPrice1")
           adoTableName.Recordset.Update
       
           Else

           adoaccess.Recordset.Fields("updateRecord") = False
           adoaccess.Recordset.Update

           
                     
        End If
     
     
        adoaccess.Recordset.MoveNext
       
    Loop

   
    MsgBox ("Sis Price Updating Done. Click OK to exit to Price Updating Interface.")
   

ProcExit:
    Call cmdQuit_Click
   
    Exit Sub
   
   
DatabaseAccessError:
    MsgBox ("Oops ! SiS Price Updating File cannot be found. Please make sure the 'SiS Price Updating Template' Microsoft Access Database is in the SiS server"), vbExclamation
   
    Resume ProcExit
     
End Sub
0
Comment
Question by:felicia
  • 3
4 Comments
 
LVL 12

Accepted Solution

by:
roverm earned 0 total points
ID: 2618768
2 ways:

1.Set a filter on your recordset and see how many records are left (.RecordCount property).

2.Using SQL: SELECT COUNT(updateRecord) FROM MyTable
GROUP BY updateRecord

How many points do you offer?......

D'Mzzl!
RoverM
0
 
LVL 12

Expert Comment

by:roverm
ID: 2620868
I'm crying: a good answer but no points!

:-((

D'Mzzl!
RoverM
0
 

Author Comment

by:felicia
ID: 2627169
sooo....sorrie...i don't know why the systems did not give points...

I attached points with it...

:)

felicia
0
 
LVL 12

Expert Comment

by:roverm
ID: 2627380
Are the points deducted from your 'Available Points' ? If so: contact EE!

Otherwise, if you still want to give the point to me then make a dummy question (like "TO ROVERM"), wait for my response and then accept my response as an answer. But you don't HAVE to !

D'Mzzl!
RoverM
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 54
Determine Range to Select 5 48
how can i unlock a picture file that was loaded in a picturebox in visual c#? 4 93
Child Form in front 4 46
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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

776 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