<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=34083602&amp;blogName=LEARN+MS-ACCESS+TIPS+AND+TRICKS&amp;publishMode=PUBLISH_MODE_FTP&amp;navbarType=BLUE&amp;layoutType=CLASSIC&amp;searchRoot=http%3A%2F%2Fblogsearch.google.com%2F&amp;blogLocale=en_US&amp;homepageUrl=http%3A%2F%2Fwww.msaccesstips.com%2F" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" allowtransparency="true" title="Blogger Navigation and Search"></iframe> <div></div>
www.msaccesstips.com

LEARN MS-ACCESS TIPS AND TRICKS


International Response Fund

LEARN MS-ACCESS TIPS AND TRICKS

↑ Grab this Headline Animator

Your Ad Here
Friday, September 22, 2006

SHADOW3D HEADING STYLE

Shadow3D Style Image

This is the continuation of a series of different 3D-Heading-Styles introduced for designing Microsoft Access Form/Report Headings. This design is a variant of the 3D-Heading Style presented under the Title Create 3D Headings on Forms. Both the Styles has its own beauty and once they are created you may copy the same Controls and customize them with different Fore-color, Font & Font Styles (Bold, Italics etc.) and use it on Form or Report Headings.

If you are the first-time visitor on this site and landed straight on this page you must prepare your MS-Access Project by adding few Library Files and Main Programs (if you have not already done) before you are able to run the Code for this Heading Style and others presented on this Site. Follow the steps given below:

1. Link few Common Library Files (they are already there in your System, you only need to attach them) to your Project by following the steps described in my earlier post with the Title Command-Button Animation

2. You need to copy all the VB Codes given under the Title Create 3D Heading on Forms and paste them into a Global Visual Basic Module in your Project and save the Module. This Code implements the Main Functions of each Heading Styles presented so far including this one.

Once you are ready with the above you may copy the Code for this Heading Style and try it out. Copy the Code below into the same Global Module, where you have copied the Main Programs, or any Global Module you prefer and save it.



Public Function Shadow3D(ByVal intStyle As Integer, _
ByVal intForeColor As Integer, _
Optional ByVal Label0Text1 As Integer) As String
'----------------------------------------------------------
'Author : a.p.r. pillai
'Date : September 2006
'----------------------------------------------------------
Dim intlbls As Integer, intFSize As Integer
Dim j As Integer, mySection As Section
Dim lblName() As String, lngForecolor As Long, X As Integer
Dim l As Long, t As Long

On Error Resume Next

Shade3D = FormTxtLabels(Label0Text1)

Set mySection = MyFrm.Section(acDetail)
intlbls = mySection.Controls.Count - 1

On Error GoTo Shadow3D_Err

X = Validate_Dup(MyFrm, 5) ' check type and duplicate

If X = 1 Then
Exit Function
End If
intlbls = mySection.Controls.Count - 1

X = intStyle
intStyle = IIf(X < 0, 0, IIf(X > 3, 3, intStyle))
X = intForeColor
intForeColor = IIf(X < 0, 0, IIf(X > 15, 15, intForeColor))

ReDim lblName(0 To intlbls) As String

For j = 0 To intlbls
lblName(j) = mySection.Controls(j).NAME
Next

For j = 0 To intlbls
With mySection.Controls(lblName(j))
.Height = lngheight
.Width = lngWidth
.FontName = "Times New Roman"
intFSize = .FontSize
If intFSize < intFontSize Then
.FontSize = intFontSize
End If
.FontUnderline = False
.TextAlign = intTextAlign
.BackStyle = intBackStyle
Select Case j
Case 0
lngForecolor = 8421504
Case 1 To intlbls - 2
lngForecolor = 8421504
Case intlbls - 1
lngForecolor = 0 '12632256
Case intlbls
lngForecolor = QBColor(intForeColor)
End Select
.ForeColor = lngForecolor
End With
Next
l = intX: t = intY

With mySection.Controls(lblName(1))
.Left = l
.Top = t
End With
For j = 0 To intlbls
Select Case intStyle
Case 0
l = l + LngI
t = t + LngI
Case 1
l = l + LngI
t = t - LngI
Case 2
l = l - LngI
t = t + LngI
Case 3
l = l - LngI
t = t - LngI
End Select
With mySection.Controls(lblName(j))
.Left = l
.Top = t
End With
Next
MsgLabel

Shadow3D_Exit:
Exit Function

Shadow3D_Err:
Msgbox Err.Description,, "Shadow3D"
Resume Shadow3D_Exit
End Function

To create the Shadow3D Heading Style:

a. Press Alt+F11 to Display the Visual Basic Editing Screen (you can toggle between Database and VB Window with this Shortcut)

b. Press Ctrl+G (or View Menu --> Immediate Window) to display the Debug Window

Type the following in the Debug Window and press Enter:

Shadow3D 1, 0

You will see the Screen flashes a little as if it is refreshed. Minimize the Visual Basic Module Window and you will see a new Form has been created with the above Heading Style. Help to customize the Control with your own Font, Font Style or Heading Text is also created in a Label Control, which you may follow to change it into your own style.

Let us examine the Command Line Values.

Shadow3D - is the Function Name

1 - First Parameter to the Function which controls the Shadow position of the Heading Text. Range of Values are from 0 to 3.

0 - Shadow position left top corner

1 - bottom left corner

2 - Right top corner

3 - Right bottom corner

0 - Second parameter 0 will create 3D Text on Label controls. By default the Function creates label based Heading Text and this can be omitted. If omitted, then do not use a coma after the first parameter. If 1 is used then the Function creates TextBox based control with Heading Text placed in a Formula in the Control Source property. You can change the Value in the Formula or change to show values from the underlying field of table/query attached to the Form. Or you can write a Dlookup() Function to pick the Value from a different Table.

Example : =Dlookup("CountryName","CountryTable","CountryCode = ‘USA’")

The above example will show United States of America in 3D Style from the CountryTable based on the Values in CountryCode & CountryName Fields. If The criteria parameter of the Function needs to obtain a Value from the current table attached to the Form then modify the Function to:

=Dlookup("CountryName","CountryTable","CountryCode = ‘“ & [CCode] & "’")

Where [CCode] is the Field Name where the country codes are stored in the Table/Query attached to the Form. Note the single quote immediately after the equal sign followed by a double-quote and the closing single quote within double-quotes before the closing parenthsis indicating the CCode field value is character type data.

Tip: Search in MS-Access Help for more details on Dlookup() Function.






Download Demo Database





Border 2D Heading Style
Border 3D heading Style
MsgBox with Office Assistant

Labels:

0 Comments:

Post a Comment

Note:Comments subject to Review by Blog Author before displaying.

Links to this post:

Create a Link

<< Home


Creative Commons License
Learn MS-Access Tips and Tricks by msaccesstips.com is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 India License.



This Page is best viewed with 1280 x 1024 Resolution

   FEATURED LINKS
SITEMAP
Command Button Animation
3D Headings on Forms
MsgBox & Office Assistant
Reminder Ticker
MS-Access & E-Mails
Automated E-Mail Alerts
MsgBox with Options Menu
Colorful Command Buttons
Configure Lotus Notes
Alerts through Network
Running this site has become a costly affair as the revenue from Ads is not sufficient to support it. If you find these pages informative & useful and would like to extend a helping hand, then please do it here.





Link Back to us with this Button

Learn MS-Access

Copy and Paste this HTML Code in your Webpage


Add to Technorati Favorites

Programming Blogs - Blog Catalog Blog Directory
Powered by FeedBurner
Add to Google

Software
Computers blogs
TopOfBlogs




AddMe - Search Engine Optimization Submit Your Site Free!
Go BlogZ Ave Blogs
eBlogzilla Changing LINKS
LS Blogs Blogarama
blog search directory BlogUniverse
Find Blogs in Directory RSS Directory
blogskinny.com ShowcaseBlogs.com
Amfibi

Search Engine Optimization and SEO Tools
Dmegs Web Directory Takeaway for Sale Businesses For Sale
Free Submission Directory Free site submission

Free Listing
 





Free Page Rank Checker

AddThis Social Bookmark Button

Enter your email address:

Delivered by FeedBurner



Top Blogs


Microsoft Access is the Jewell among MS-Office suite of Applications. Its Security features are excellent and works fine in Network environment. MS-Access can link/upload data from any Data Source. Applications that you design should be user-friendly and visually pleasing too. Here I would like to share my experience in Microsoft Access Programming with you and I am sure that you will find them interesting too.

My Photo
Name: Ramachandran Pillai
Location: Cochin, India

I am not an Access Guru and not through MS-Access yet. More to learn and I don’t think that aspect has any end because others have their own style of using this tool. We can learn lot more tricks, other than what we already know, from others too. My programming skills in COBOL, BASIC, Turbo-C, dBase, FoxPro, Visual Basic & Basic HTML attained through self-learning. I wrote my first COBOL Program in 1975 for ICL1901, 3rd Generation Main Frame Computer. Worked as a Computer Operator (NCR VRX8555 Mainframe Machine upto 1990) with M/s. Y.B.A. Kanoo, Saudi Arabia. Started using MS-Access Ver.2 in 1996, when dBase III+ and Foxbase (later version Foxpro) were my favorite DBMS. During Last 13 Year period I have developed more than 45 In-House Applications (medium & small) under MS-Access for our Organization, a leading Automotive Company in Oman. All the Applications are fully Secured and runs under Windows Network. It is my pleasure to share my experience with others. Anything interesting that you would like to share with me, please do. My E-mail Address: aprpillai@msaccesstips.com


If you need a Demo of any of the Topic explained here, send me an E-mail to: aprpillai@msaccesstips.com
with the Topic Description, I shall try to send a sample database to you.


Access Tips | Email | Reports | Report Tricks | Graphs | Forms | Menus | Animation | Security | Internet | How TOs | Linking | Query | Progress Meter | Alerts | Process Tips | Access Functions |




Site Designed by:www.msaccesstips.com