I am to create a form with 2 text boxes to receive numbers as input and 1 command button that displays a message box containing the larger of the two numbers. To do so, I need to write code in the Click event of the command to call a user-defined function named FindLargestNumber. Pass it 2 arguments(textboxvalues) and display the result in a message box. Write code in the FindLargestNumber function to determine the larger number and return result to the calling procedure(command button Click event).
Can anyone help me out on this? Here's my code thus far, which isn't working:
Option Compare Database Private Sub cmdCompare_Click() If Number1 > Number2 Then MsgBox "txt.Number1.value" ElseIf Number2 > Number1 Then MsgBox "txt.Number2.value" End If End Sub Public Function FindLargestNumber(Number1 As Double, Number2 As Double) End Function