Private Sub CommandButton4_Click()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim searchstring As String
' connect to the Access database
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Ace.OLEDB.12.0; " & _
"Data Source=C:\Users\Desktop\TestDBA\Tracking_be.accdb"
' open a recordset
Set rs = New ADODB.Recordset
search = txtDate.Value
search2 = txtBranchNo.value
searchstring = "SELECT businessDate, advances, advanceAmount, denied, newAccounts, stopPayments,wires, cpg,branchLoc FROM tblMsrTotals WHERE [businessDate] = '" & search & "'"
rs.Open "tblMsrTotals", searchstring, cn, adOpenStatic
txtbusinessDate.Text = rs.Fields("businessDate") 'or whatever
txtadvances.Text = rs.Fields("advances") 'or whatever
txtadvanceAmount.Text = rs.Fields("advanceAmount") 'or whatever
txtdenied.Text = rs.Fields("denied") 'or whatever
txtnewAccounts.Text = rs.Fields("newAccounts") 'or whatever
txtstopPayments.Text = rs.Fields("stopPayments") 'or whatever
txtwires.Text = rs.Fields("wires") 'or whatever
txtcpg.Text = rs.Fields("cpg") 'or whatever
txtbranchLoc.Text = rs.Fields("branchLoc") 'or whatever
Set rs = Nothing
End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.