|
2#
楼主 |
发表于 2006-9-18 01:58:00
|
只看该作者
如以下一段程序 报编译错误 急死拉
Dim db As Database, qry, qry1 As QueryDef
Dim dbs As Database
Dim db1 As Database
Dim rst, rst1 As Recordset
Dim rst2, rst3, rst4, rst5 As Recordset
Dim strsql As String
Dim tmp, temp, file As Variant
Dim files As Variant
Dim i, j, k, m, n, P As Integer
Dim count As Integer
Dim tbtmp As TableDef
Dim fvalue As String
Dim r, s As Integer
Dim a1, a2, a3, a6 As Variant
Dim a4, a5 As Single
Dim W1, w2, w3 As Integer
Dim b As Integer
Dim D1, D2, d3, d4, d5, d6 As Single
Dim test As String
Dim r1, r2, r3, r4, r5 As Variant
Dim d11 As Long
Dim j1, j2 As Integer
Dim x As Integer
Dim Y As String
Dim a As String
Dim T As Integer
Dim strQuote As String
Dim c As String
Dim T1, T2, T3, T4, T5, t6, t7, t8, t9, t10, t11, t12 As Variant
Dim mn As Boolean
Dim t100 As Integer
Dim q As Integer
Dim c1 As Integer
Dim c2 As Integer
Dim s1 As String
Dim Q1, Q2, Q3 As Integer
Dim Check As Integer
Dim Temp1 As Integer
Dim strMsg As String
Dim strInput As String
c = Me.MDDRef
T2 = 0
strQuote = Chr(34)
Set db = CurrentDb
strsql = "SELECT [mddref] FROM [product] WHERE ([mddref]="
',[mddref],[supplier no],[cname],[unit price],[order quantity],[order amount],[color],[supplier ref],[address],[chname],[contract date],[real stock],[process stock],[security stock]
strsql = strsql & Chr(34) & c & Chr(34) & ");"
Set qry1 = db.CreateQueryDef("", strsql)
Set rst = qry1.OpenRecordset
rst.Requery
r = rst.RecordCount
If r = 0 Then
MsgBox "congratulation!!!,you can use the product ref!!!"
Else
MsgBox "lease change to another ref,it's existed!!!"
Exit Sub
End If
rst.Close
Set db = Nothing
|
|