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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do You Get a VB Variable to Show up on an Access Report?

Status
Not open for further replies.

Chinyere

Programmer
Mar 9, 2001
79
US
Hello All,

I am trying to create an Access report and am using the VB Code "in the background." My question is this: how do I get a vriable that I have on this VB coding area to appear on my Access report? The code looks something like this:
________________________________

Option Compare Database

Dim intVar1 As Integer

intVar1 = 5
________________________________

How does one get the variable 5 (in this example) to appear on an Access report?

I would appreciate any quick assistance as I am crunching on a project. Thanks.

Chinyere :-D
 
One way would be to write a function that simply returns the value of the variable, and set the report control's Control Source to [red]=TheFunction()[/red].

By the way, if you're working in Access, you're using VBA (Visual Basic for Applications), not VB. VB is a different, stand-alone development product. This question would have best been posted in the Microsoft: Access Reports forum. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top