Article ID: 180810
Article Last Modified on 1/22/2007
Function IsInternational(strCountry As String) As String
If strCountry = "USA" Then
IsInternational = "Local"
Else
IsInternational = "Intl"
End If
End Function
Query: qryExcelTest
--------------------------------------
Type: Select Query
Field: CompanyName
Table: Customers
Field: Country
Table: Customers
Field: Expr1: IsInternational([Country])
Sub xlTest()
Dim db As Database, rs1 As Recordset
Dim qry As QueryDef
Set db = Workspaces(0).OpenDatabase _
("C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb")
' Replace the above path with the correct path to the
' sample Northwind.mdb database on your computer.
Set qry = db.QueryDefs("qryExcelTest")
Set rs1 = qry.OpenRecordset
rs1.MoveLast
rs1.Close
db.Close
End Sub
Additional query words: prb
Keywords: kbcode kberrmsg kbprb kbprogramming KB180810