Solved

ADO Field Record Count...

Posted on 2000-03-14
4
271 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

734 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