Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 22155

Need Help

$
0
0
Dear Reader,

I apologize in advance for the extremely vague title. My situation is this:

On my PC I have a tool that a previous developer made and I'm trying to find out a specific process he made and why he made it. Basically, we have these Rows in an Excel Worksheet that can be viewed and editted through the tool. When they are edited a prefix of "XXX" is added on to the Row. Let's call the Row an "Item" for now. I apologize I can't give too much information as the tool is for internal use only. Anyways, so the "Item" now has a prefix of XXX so the entire title of the Row, or "Item" is now something like XXX012562. I'm wondering why the XXX's are added in, they aren't needed and I can't find a use for them. Here is the code I can share:

Code:

Private Sub DeleteBlitXtip(ByVal strRO As String)


    Dim rsBlitZ As ADODB.Recordset
    Dim strSql As String
    Dim lngRecord As Long
    strSql = "Select * from [Report$] WHERE REPAIRORDER = '" & strRO & "'"
   
    Set rsBlitZ = New ADODB.Recordset
    rsBlitZ.Source = strSql
    rsBlitZ.ActiveConnection = cnnRO
    rsBlitZ.LockType = adLockOptimistic
    rsBlitZ.Open
     
  Do Until rsBlitZ.EOF = True
       
        If rsBlitZ!RepairOrder = strRO Then
            rsBlitZ!RepairOrder = "XXX" + rsBlitZ!RepairOrder
        End If
         
   
        rsBlitZ.MoveNext
    Loop
   
    strSql = "UPDATE [QC$] SET  RepairOrder = 'XXX" + strRO & "' WHERE REPAIRORDER = '" & strRO & "'"
    cnnRO.Execute strSql

    rsBlitZ.Close
    Set rsBlitZ = Nothing


End Sub

My part that I'm confused about is

Quote:

If rsBlitZ!RepairOrder = strRO Then
rsBlitZ!RepairOrder = "XXX" + rsBlitZ!RepairOrder
End If
Because strRO is just a string and isn't privately or publicly declared so how can something something be dependent on it (rsBlitZ!RepairOrder)?

Sorry if I'm adding any information that is unnecessary or leaving something out. I work with 2010 so VB6 is a little different for me. But I'm figuring it out as I go along.

Thank you for taking the time to look into my problem.

Viewing all articles
Browse latest Browse all 22155

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>