Share this Page URL

Chapter 17. Using Visual Basic to Manage... > Using Visual Basic to Work with Data... - Pg. 601

Using Visual Basic to Manage Data 1. 601 In the Database window for the HelloWorld17 database, select the form named CampaignIn- formation, and then click Open. The form, which we first created in Chapter 7, "Designing Basic Forms," is shown here: 2. We've added a command button (labeled Create Presentation) to the form for this example. In the steps that follow, we'll modify the code in the button's Click event procedure so that the controls on the CampaignInformation form (including the labels) are displayed as items in a bulleted list on a PowerPoint slide. We've also added two text boxes to the CampaignInfor- mation form--YTD Order Amount and Campaign Sales Goal. The data displayed in the YTD Order Amount text box comes from a query named qryProductsByCountrySummary, which we've added to the form's record source. The query totals the amount ordered by customers in each country during the order year 1998 (the latest year of data in the Northwind Traders database). On your own, you can open this query in Design view if you want to look at how it is put together. The Campaign Sales Goal text box uses an expression that multiplies the year- to-date order amount by 20 percent. Click the Create Presentation button. After PowerPoint opens, you'll see the Presentation window with a single slide, as shown here. The text in the slide's title is provided by the value of the Headline text box on the CampaignInformation form. (The text you see depends on which campaign's record is displayed in the form.)