Store two Queries result in third variable

后端 未结 3 355
名媛妹妹
名媛妹妹 2020-12-22 12:02

What\'s wrong with this code:

Visual Basic 6.0 With access 2007

Private Sub Command1_Click()
Dim Sell_tbl, Stock_Bottle, res As String


Sell_tbl =         


        
3条回答
  •  隐瞒了意图╮
    2020-12-22 13:02

    The reason for the error is because of statement:

    s = ((Sell_tbl) - (Stock_Bottle))
    

    If you look above that line, you are setting two string variables to SQL -- which is text not numeric. You need to open recordsets with those sql strings, then get the results, then perform the math.

提交回复
热议问题