Copy and paste code from the

Many programmers start their careers not so much by writing code from scratch but rather by using code that others have written and adapting it to their own needs.

You can use your favorite search engine to find a wealth of code on the Web. For example, to search for code examples for an If...Then statement, type If Then in the search engine. You'll probably get all kinds of useless results. To narrow the results to something more useful, add the words Access VBA to your search. For example, typing Access VBA If Then provides a more useful list of links.

Suppose your search turns up a Web page that gives the code for a sample procedure. Rather than type the whole procedure into your own module, you can copy it from the Web page. First, select the procedure (and nothing but the procedure) by dragging the mouse pointer through the whole procedure — from the starting Sub or Function statement to the ending End Sub or End Function statement. After you select the code, press Ctrl+C or right-click anywhere in the selected text and choose Copy, as shown in Figure 3-8.

After you select and copy the code, just click anywhere in a standard module and press Ctrl+V or right-click and choose Paste. The exact code you selected appears in your module.

You can find most of the code examples from this book at www.dummies.com/ go/access2007vbaprog. You can copy and paste any code from that site into any module in your own database.

Figure 3-8:

Use sample VBA code from a Web page.

Figure 3-8:

Use sample VBA code from a Web page.

Vba Search Engine

Was this article helpful?

0 0
Search Engine Optimization

Search Engine Optimization

Discover The Secrets to Improve Your Site Ranking! Have you been wondering how you can draw more traffic to your website? Do you want to boost sales or do a better job of promoting your website online but have no idea how to go about it?

Get My Free Ebook


Post a comment