我该如何把form1中text1 的值,传递到form2中
"SELECT  * from Image where id="text1的值" "

解决方案 »

  1.   

    "SELECT  * from Image where id=" & form1.text1的值
      

  2.   

    1、等号不能用大写,用小写。
    2、如果字段ID是字符型就写成:"SELECT  * from Image where id='" & trim(form1.text1.text) & "'"
      

  3.   

    "SELECT  * from Image where id='" & trim(form1.text1.text) & "'"
      

  4.   

    Form1 中:Public Function GetTextValue() As String
        GetTextValue = text1.Text
    End FunctionForm2 中:"SELECT  * from Image where id = '" & Form1.GetTextValue () & "'"
      

  5.   

    呵呵,大家都说了,我补充一点吧,记得对 text 的内容作点处理,不然 ' (单引号)可能会闹事。"SELECT  * from Image where id='" & replace(form1.text1.text,"'","''") & "'"