Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

How to pull/push a value from the current form to a Module using VBA

$
0
0
Using the code below I am able to open an explorer window from access and select most of a file path. The part I am not able to get is "LN" which is a field in my forms. I need to be able to pull the current LN number into my Modules file path. How do I do this? Is it easier to go by ID or the actual field I am looking for?


Code:

Function Loan_Folder_Search3()
      Dim rs              As Recordset
      Dim LN              As String
      Dim Client_Name    As String
      Dim RetVal          As String
      Dim LFPath          As String
           
     
     
      Set rs = CurrentDb.OpenRecordset("SELECT ID, LN, Client_Name FROM [Loan_Info_local]")
      LN = rs![LN]
     
      Client_Name = rs![Client_Name]
           
      Select Case Client_Name
     
      Case "Bank of David, N.A."
        LFPath = "\\MAXSERVER\Max Default\BOD\"
        RetVal = Shell("explorer.exe " & LFPath & LN, vbNormalFocus)
       
      End Select
     
      rs.Close
      Set rs = Nothing

End FunctionCurrently, it keeps pulling the first reccord, no matter what reccord I'm on.
Thank you,
David92595

Viewing all articles
Browse latest Browse all 13329

Trending Articles