Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting text box values into Microsoft Access Report

Status
Not open for further replies.

impulse24

IS-IT--Management
Jul 13, 2001
167
US
I have a vb form that uses DAO to access a Microsoft Access database. User's perform queries, and updates. I have created a report within the Access database. How do I plugin values from a textbox on my Visual Basic form into the Access Reports? Been looking for this forever
 
If your report is based off a query, I've had a lot of luck modifying the actual query with text or input from VB. See below I've modified a query based off input of a start date (dteStart), an end date (dteEnd), and even a selection from a combobox (intFilter). Hope that helps
Stacey

Dim cmd As ADODB.Command
Set cmd = New ADODB.Command

cmd.CommandText = "SELECT NetBill.StateBAN, " & _
"NetBill.NetDate, NetBill.NetAmt, [SummaryAcctNum]![State] & ' ' & [SummaryAcctNum]![BAN] AS sb," & _
" SummaryAcctNum.ServProv, summaryacctnum.clec " & _
"FROM SummaryAcctNum right JOIN NetBill ON SummaryAcctNum.StateID = NetBill.StateBAN" & _
&quot; WHERE (((NetBill.NetDate)>=#&quot; & dteStart & &quot;# And (NetBill.NetDate)<=#&quot; & dteEnd & &quot;#)&quot; & _
&quot; and ((summaryacctnum.servprov)= &quot; & intFilter & &quot;));&quot;

Set cmd = Nothing

Set catDB.Views(&quot;initialnetbill&quot;).Command = cmd

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top