Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Re: Can't find 'rs'


Message #1 by "Rojan Cadiz" <RCADI@a...> on Wed, 19 Feb 2003 16:47:12 +0800
Hi everybody,
I'm Working on a form which is some sort of calculator. The values to be
computed
is stored in a table. I created an object (UPHFormula) wherein the values
will be stored for validation.
When I evaluate the object (UPHFormula) it gives me this error: "Can't find
the name 'rs' in the expression
you have entered. Attached is the complete code I've made for this. Kindly
help me on this.

Function ComputeUPH()

    Dim db As Database
    Dim rs As Recordset
    Dim rsActivities As Recordset
    Dim strSQL As String
    Dim strFields As String
    Dim i As Integer

    Set db = CurrentDb()

    With Form_UPHFormula_frm

        strSQL = "SELECT ProcessMachActivities.Activity, ProcessMachActivities.ActivityValue " & _
                 "FROM ProcessMachActivities " & _
                 "WHERE (((ProcessMachActivities.Plant)='" & .Plant & "') AND " & _
                        "((ProcessMachActivities.PkgFamily)='" & .PkgFamily & "') AND " & _
                        "((ProcessMachActivities.MachineID)=" & .MachineID & ") AND " & _
                        "((ProcessMachActivities.ID)='" & .ID & "'));"
        Set rsActivities = db.OpenRecordset(strSQL)

        strSQL = "SELECT Parameters.Plant, Parameters.PkgFamily, Parameters.ID, Parameters.WfrDiam, " & _
                    "Parameters.DieSizeL, Parameters.DieSizeW, Parameters.SubLotQty, Parameters.UPS, " & _
                    "Parameters.SPM, Parameters.WfrCst, Parameters.Wires, Parameters.CutSpeed, " & _
                    "Parameters.DicePerWfr, Parameters.GoodDicePerWfr, Parameters.CH1, Parameters.CH2, " & _
                    "Parameters.CH1CutTime, Parameters.CH2CutTime, Parameters.CureTime"

        With rsActivities
            Do While Not .EOF
                strSQL = strSQL & ", " & !Activityvalue & " as " & !Activity
                .MoveNext
            Loop
        End With

        strSQL = strSQL & " FROM [Parameters] " & _
                          "WHERE (((Parameters.Plant)='" & .Plant & "') AND " & _
                                 "((Parameters.PkgFamily)='" & .PkgFamily & "') AND " & _
                                 "((Parameters.ID)='" & .ID & "'));"
        Set rs = db.OpenRecordset(strSQL)

        .UPH = Eval(.UPHFormula)





  Return to Index