This article was previously published under Q208202
Advanced: Requires expert coding, interoperability, and multiuser skills.
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.
View products that this article applies to.
Option Explicit
Function MultiplyByTen(clsVar As Variant) As Variant
MultiplyByTen = clsVar * 10
End Function
Option Explicit
Function CallMultiplyByTen(stdVar As Variant) As Variant
Dim clsMultiply As New MultiplyClass
CallMultiplyByTen = clsMultiply.MultiplyByTen(stdVar)
End Function
?CallMultiplyByTen(5)
Query: Query1 ----------------------------------------- Type: Select Query Field: OrderID Table: Orders Field: Freight Table: Orders Field: EXPR1: CallMultiplyByTen([Freight])
Option Explicit
Function MultiplyByTen(clsVar As Variant) As Variant
MultiplyByTen = clsVar * 10
End Function
Query: ClassTestQuery -------------------------------------- Type: Select Query Field: Freight Table: Orders Field: Expr1: MultiplyByTen([Freight])
Form: ClassTestForm ------------------------- Caption: TestForm ControlSource: Test Table Text box: --------------------------- Name: Freight Caption: Freight ControlSource: Freight Text box: ------------------------------ Name: Text1 Caption: Text1 ControlSource: =MultiplyByTen([Freight])
Report: ClassTestReport --------------------------------------- ControlSource: Orders Table Text box: --------------------------------------- Name: Freight Caption: Freight ControlSource: Freight Text box: --------------------------------------- Name: Text1 Caption: Text1 ControlSource: =MultiplyByTen([Freight])
Macro Name Action -------------------------------- ClassTestMacro MsgBox ClassTestMacro Action Arguments -------------------------------- MsgBox Message: =MultiplyByTen(5) Beep: Yes Type: None
Keywords: KB208202, kbcode, kbprb, kbprogramming