Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Functions call within a function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-27-07, 15:05
mustish1 mustish1 is offline
Registered User
 
Join Date: Jul 2006
Posts: 145
Functions call within a function

Below is the function which receive the clt_ref_no in AcctNum. I dont want to disturb that function. What i need is within that function it calls two new functions and pass the same AcctNum into new functions. Query will be little change for both functions. For the first function

Select LongStr from dbtrudf du left outer join debt as d on (d.debt_id = du.debtor_id,0) where label = 'BankruptcyChapter'
and clt_ref_no = '5499440916866424'

For the second function
Select LongStr from dbtrudf du left outer join debt as d on (d.debt_id = du.debtor_id,0) where label = 'CaseNumber'
and clt_ref_no = '5499440916866424'

At end in both new functions it returns the value into new variables. I mean in both new functions i need value from field LongStr. The two functions basically give me the value if Label="CaseNumber" or Label="BankruptcyChapter". so the new two function holds value for CaseNumber and BankruptcyChapter from field LongStr

Public Function GetBankruptcyDate(ByVal AcctNum As Variant) As String
Dim RS As New ADODB.Recordset
Dim DBConn As ADODB.Connection
Dim SQL As String, strDate As String

AcctNum = Trim(AcctNum)

SQL = "set temporary option user_estimates = 'enabled'; " & _
" Select date1 from dbtrudf du " & _
" left outer join debt as d on (d.debt_id = du.debtor_id,0) " & _
" where label = 'FileDate' " & _
" and clt_ref_no = '" & Trim(AcctNum) & "'"
Debug.Print SQL
Set DBConn = CommonFunctions.GetDBConn
Set RS = DBConn.Execute(SQL)

If Not RS.EOF And Not IsNull(RS!DATE1) Then
strDate = Format$(CStr(RS!DATE1), "yyyymmdd")
Else
MsgBox AcctNum & " is an 03A with no Bankruptcy date!"
End If
GetBankruptcyDate = strDate
End Function

Thanks.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On