User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 429,890 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,311 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser: Programming Forums

Pass arguments to a Function

Join Date: Jan 2008
Posts: 29
Reputation: boblarson is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
boblarson's Avatar
boblarson boblarson is offline Offline
Light Poster

Re: Pass arguments to a Function

  #2  
Mar 31st, 2008
This is roughly what you want. Don't know what you want for the result so I returned the value that was the largest.

Option Compare Database

Private Sub cmdCompare_Click()
   MsgBox "The largest number is " & FindLargestNumber(Me.Text1,Me.Text2)
End Sub

Public Function FindLargestNumber(dblNumber1 As Double, dblNumber2 As Double) As Double
  If dblNumber1 > dblNumber2 Then
     FindLargestNumber = dblNumber1
  End If

  If dblNumber2 > dblNumber1 Then
     FindLargestNumber = dblNumber2
  End If

End Function
Bob Larson
____________________________________
Access MVP
For Quick Tutorials and Samples for Microsoft Access: BTAB Development
Reply With Quote  
All times are GMT -4. The time now is 8:47 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC