当我在VB中使用.Contains时,我有一个错误424“需要对象”。
请参阅以下代码:
Set oRst = oDB.OpenRecordset("Check Task Aircraft Listing", dbOpenDynaset)
Do While oRst.EOF = False
Dim revNumber As String
revNumber = oRst.Fields("CTAL_Rev")
Dim aircraft As String
aircraft = Me.aircraf
Dim truc As Boolean
truc = Revnumber.Contains(aircraft) <= error
If truc = True Then
...
有人知道什么是错的吗?
答案 0 :(得分:1)
String.Contains
是VBA不支持的VB.NET构造。 (VBA 比VB.NET旧。)VBA等价物将是
truc = (InStr(revNumber, aircraft) > 0)