Good Morning! I am still very new to VBA, and I'm getting an error that I can't figure out with a basic code. Here's what I have at this point:
Option Compare Database
Option Explicit
Private Sub cmdLarger_Click ()
FindLargestNumb er
End Sub
Public Function FindLargestNumb er(ByVal Number1 As Double, ByVal Number2 As Double)
Number1 = Val(txtOne.Valu e)
Number2 = Val(txtTwo.Valu e)
End Function
This is only the beginning of the code for a project, but when I click on the command button, I get "argument not optional". I think it might be how I've declared the function, but I'm not sure what I'm doing wrong. Any help you can provide would be amazing.
TJ
Option Compare Database
Option Explicit
Private Sub cmdLarger_Click ()
FindLargestNumb er
End Sub
Public Function FindLargestNumb er(ByVal Number1 As Double, ByVal Number2 As Double)
Number1 = Val(txtOne.Valu e)
Number2 = Val(txtTwo.Valu e)
End Function
This is only the beginning of the code for a project, but when I click on the command button, I get "argument not optional". I think it might be how I've declared the function, but I'm not sure what I'm doing wrong. Any help you can provide would be amazing.
TJ
Comment