Office中国论坛/Access中国论坛

标题: SQL句中如何嵌套控件? [打印本页]

作者: kelind    时间: 2005-5-30 04:31
标题: SQL句中如何嵌套控件?
delete * from 表名      中要输入表名才能运行.在窗体上有文本框1, 我想要删除哪个表,在文本框或列表框中选择.我试着:

dim  ab as string

ab = me.文本框1

delete * from ab (  或:'& ab &',  ' ab ', & ab &) 不行.

dim myobject as object

set myobject = me.文本框1

delete * from myobject (或'& myobject &'  ; 'myobject'  ;  & myobject &)

都不行.请问该如何嵌套?
作者: 海狸先生    时间: 2005-5-30 04:34
Dim stra As String

stra = "表1"

DoCmd.RunSQL "delete * from " & stra




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3