Link to home
Start Free TrialLog in
Avatar of felicia
felicia

asked on

ADO Field Record Count...

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
ASKER CERTIFIED SOLUTION
Avatar of roverm
roverm
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm crying: a good answer but no points!

:-((

D'Mzzl!
RoverM
Avatar of felicia
felicia

ASKER

sooo....sorrie...i don't know why the systems did not give points...

I attached points with it...

:)

felicia
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