I need to manage a report using VB, but I don't know how to set a reference to it in code, in order to read the value of a textbox in the page #X, or in order to browse pages of the report programatcally.
Hi,
When you mention "VB", are you referring to Visual Basic 6.0, or the VB that comes with Access? If it is the VB inside of Access, this is commonly referred to as VBA (Visaul Basic for Applications).
Getting back to your question: If you are running an Access report, you can read and manipulate the text boxes inside the OnFormat event for the section you wish to modify.
However, it sounds like you really want to access specific information being returned to the report from a data source, such as a table or query. If this is the case, you can use the DLookup function to retrieve individual values. If this is what you want to do, please reply back to this post and I will give you some code examples of this.
If you wish to run an Access report from Visual Basic 6.0, I can also give you the code on how to do this as well. Just let us know, ok? HTH,
Randy Smith
California Teachers Association
Hello, Randy. Thanks for your reply.
Actually I use VBA inside Access to create and open the report, but I have very particular needs. I generate a report with several pages containing information about several customers (e.g. invoices), and I want to fax them using Winfax (by automation). So, I thougt the best was to browse page by page and read the content of a text box called FAX_N and send it out to that fax number.
The problem is that I couldn't find any way to set a reference to the open report and automate such a simple thing. It would be useful to create custom controls to browse the pages, overriding the reports's navigation buttons. Don't you think so?
Thanks again for your interest, and congratulations, I see that you are an active and helpful member of this community.
Hi,
Ok, here is one idea to start working with. I presume that each invoice only belongs to one customer, is that correct? Did you know that you can have textboxes on the page header that are not visible to the reader? You can set the visible property to False, but you can still get access to the information contained within it. So, this is where you can plug in the fax phone number. You can then place code in the page footer, since each page belongs specifically to a single customer.
Re: faxing. I haven't been able to find anything on Winfax, but you can fax with the Microsoft Fax product. I have a link to a Microsoft FAQ on this topic:
Hi,
That link I just gave you has some reports samples that can be downloaded. It is called: RptSmp00.exe
Well, I downloaded it, and WHAM!!!! It has a sample of how to fax using WinFax. I haven't yet uncovered the code, but it looks like this is exactly what you are looking for. HTH,
Randy Smith
California Teachers Association
Hi,
More info. You can find the code to that uses WinFax inside the modules section. Look for "modFaxExample", then click on Design. Scroll down until you see the function called "WinFaxInvoices". Also take a look at the function "SendWinFax". HTH,
Randy Smith
California Teachers Association
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.