[em06]
问题1:
set dbs=currentdb()
Set t = dbs.OpenRecordset("SELECT [NAME],TIME,CLASS FROM [PUB TABLE] WHERE [CLASS]= '" & A & "' ORDER BY ID", dbOpenSnapshot)
If Not t.BOF Then
[TIME] = "1992"
Else
MsgBox " lease YOUR NAME?"
Cancel = True
NAME.SetFocus
End If
t.Close
问题是“compile error:variable not defined" 指“cancel" hasn't defined? 是否 IF....SELECT...ELSE...的语法不对?错在哪了?
问题2:
SET BD=CURRENDB()
SQL="SELECT NAME, MAX(TIME) AS [ATTEN TIME] FROM [PUB TABLE] GROUP BY NAME"
SET T =BD.OPENRECORDSET(SQL)
执行到SET T =BD.OPENRECORDSET(SQL) 出现:Run time error:3136 "the level clause includes a reserved word or argument that is missplled or missing...."
如何解决?请各路高手赐教!!谢谢!!!
[此贴子已经被作者于2005-9-5 12:32:22编辑过]
|