<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
Thursday, September 14, 2006

BORDER3D HEADING


If you have landed straight into this Page please refer my earlier Posts: Command-Button Animation to link the essential Library Files (the list of files and explains how to attach them) to your Project and visit Create 3D Headings on Forms to copy and paste the Main Programs

FormTxtLabels()

Validate_Dup()

MsgLabel()

(which are required to Run the Function introduced here) into the Visual Basic Global Module of your Project.


The following Function creates a beautiful Heading. The Font, FontStyle (Bold, Italic) Shadow, Border and Forecolor can be customized.

Copy and paste the following Code below in the same Global Module where you have pasted the Main Programs as mentioned above or in a separate Global Module:


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

On Error Resume Next

I = 0.0104 * 1440 ' 0.0104 inches


Border3D = FormTxtLabels(Label0Text1)

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

On Error GoTo Border3D_Err

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

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

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

ReDim lblName(0 To intlbls) As String

ForeColor = QBColor(intForeColor)
BorderColor = QBColor(intBorderColor)

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
End With
Next

mySection.Controls(lblName(intlbls)).ForeColor = ForeColor

For j = 0 To intlbls - 1
mySection.Controls(lblName(j)).ForeColor = BorderColor
Next

l = intX: t = intY

With mySection.Controls(lblName(intlbls))
.Left = l
.Top = t
End With

For j = 2 To intlbls - 1
With mySection.Controls(lblName(j))
Select Case j
Case 2
.Left = l + I
.Top = t + I
Case 3
.Left = l + I
.Top = t - I
Case 4
.Left = l - I
.Top = t + I
Case 5
.Left = l - I
.Top = t - I
End Select
End With
Next

For j = 0 To 1
With mySection.Controls(lblName(j))
'.ForeColor = 9868950
.ForeColor = 0
If j = 0 Then
Select Case intStyle
Case 0
.Left = l - (I * 3)
.Top = t - (I * 3)
Case 1
.Left = l - (I * 3)
.Top = t + (I * 3)
Case 2
.Left = l + (I * 3)
.Top = t - (I * 3)
Case 3
.Left = l + (I * 3)
.Top = t + (I * 3)
End Select
Else
Select Case intStyle
Case 0
.Left = l - (I * 2)
.Top = t - (I * 2)
Case 1
.Left = l - (I * 2)
.Top = t + (I * 2)
Case 2
.Left = l + (I * 2)
.Top = t - (I * 2)
Case 3
.Left = l + (I * 2)
.Top = t + (I * 2)
End Select
End If
End With
Next
MsgLabel

Border3D_Exit:
Exit Function

Border3D_Err:
Msgbox Err.Description,, "Border3D"
Resume Border3D_Exit
End Function

To Create the Border3D Heading Text, display the Debug Window (Immediate Window)by pressing Ctrl+G (if you are already in the Visual Basic Module otherwise press Alt+F11 to display that first) then type the following line in the Immediate Window:


Border3D 1,15,0


The Module window will flash for a moment as if it is refreshed. Minimize the VB Module Window and you will see a New Form Created and kept minimized by the Program. Restore the Form and Save it with the Heading Text.


First let us see the Values entered as Parameter to the above Function. The first two Parameters are mandatory when the function is called and if they are not used the program will show Error Message 'Parameter not optional' and the third value is optional.


Parameter Values:


First Value 1 represents the Shadow Style and Value Range is 0 - 3 for the shadow tilted to any one of the four corners of the Text. The Value 1 will place the Shadow at left Bottom Corner of the Text.

The Second Value 15 represents Border Color and the Value Range is from 0 to 15 (15 = White).

Third Value 0 or 1 is optional and if omitted, 0 is assumed and it will create a Label based Heading Text, 1 will create a TextBox based Heading.

After creating the Heading Select all the controls together by clicking outside the controls and dragging the mouse over them. Once all the controls are selected together display the Property Sheet (Press F4 or View Menu--> Property) and change the Caption to your own Text. Change the Font, Font Size, Font Style Bold or Italic. Now click somewhere on the form away from the controls to de-select them then click on the top layer of the Labels and change the ForeColor of the Heading to your choice. Now Select all of them as you did earlier press Ctrl+C to Copy them into clipboard, Open your Form or Report in Design view and Paste the Heading on it. This Form you can save it as a Template so that you can copy, modify and use it on other Forms or Reports without running the Program from the Module window.


--oOo--





Download Demo Database





Border 2D Heading Style
Create 3D Headings
Shadow 3D Heading Style

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