Saturday, August 23, 2008

MS Access not closing

MS Access not closing
The problem is caused by code behind a subform which references a boolean control on the main form and evaluates it in an If Then statement as
If me.Parent!chkSomeCheckBox then
The resolution is to do the True/False comparison explicitly.
If me.Parent!chkSomeCheckBox = True then
1) Call the Close method for every object that supports it, and set to
Nothing:
rs.Close
db.Close
set rs = nothing
set db = nothing
2) Close all text files that you Opened:
Close #1
3) Set to Nothing any global object references:
Set myobj = Forms!myform!myobj
...Set myobj = Nothing
4) Change "." notation to "!" notation.
Me.TextBox3 -> Me!TextBox3
5) Use the Value property on boolean object references:
Forms!finalcheck2.Check51 -> Forms!finalcheck2.Check51.Value
For the MS view on the problem, see KB article Q164455.

MS-Access: Reattach tables

Reattach tables

Here is a little bit tricky one. Enjoy!

Public Function smsTrickyAutoRefreshLink() As Boolean
'*+
'
ose : Auto refresh links to the back-end mdb file(s)' tables which '
' Pur
p : is(are) located in the ***same*** directory as front-end one. '
Front-end and back-end databases are located in the same '
' Assumptions : Back-end database(s) is/are MS Access one(s) '
: : directory. ' : Front-end database FileName is equal to its
ase(s) name(s) is/are constant. ' ' Returns : True
' : Tools->Options->Advanced->Project Name. ' : Back-end data
b - Links were refreshed successfully. ' : False - Error detected during links auto refreshment. '
en : 98/04/18 ' ' Tested on : MS Access 97/WinNT 4.0
' Author : Shamil Salakhetdinov, St.Petersburg, Russia ' e-mail : shamil@marta.darts.spb.ru ' ' Writ
t' ' Comments : - The links are refreshed only if you move both front- and back-end ' : to the new directory.
directory and back-end into another ' : links refreshment fails
' : - If you copy/move front-end only the links aren't refreshed. ' : - If you move front-end into one
. ' : - etc... ' '- On Error GoTo smsTrickyAutoRefreshLink_Err Dim tdf As TableDef Dim i As Integer Dim strBackEndFileNameExt As String Dim strTst As String
SysCmd acSysCmdSetSta
Dim strConnect As String DoCmd.Hourglass True SysCmd acSysCmdSetStatus, "Starting links auto refreshment..." ' look for linked table(s) For Each tdf In CodeDb().TableDef
stus, "Processing table [" & tdf.Name & "]..." If tdf.Connect <> "" Then On Error Resume Next ' check that link is actual strTst = DBEngine(0).OpenDatabase(Mid(tdf.Connect, 11)).Name
& "]..."
If Err <> 0 Then ' clear error and reset last On Error handler On Error GoTo smsTrickyAutoRefreshLink_Err SysCmd acSysCmdSetStatus, "Refreshing link of table [" & tdf.Nam
e ' get the Filename.Ext of backend mdb for current link strBackEndFileNameExt = "" For i = Len(tdf.Connect) To 1 Step -1 If Mid(tdf.Connect, i, 1) <> "\" Then
string strConnect = ";Database=" & _ Mid(CodeDb().Na
strBackEndFileNameExt = Mid(tdf.Connect, i, 1) & strBackEndFileNameExt Else Exit For End If Next ' get new connect
me, _ 1, InStr(1, CodeDb().Name, _ GetOption("Project Name")) - 1) & _ strBackEndFileNameExt If strConnect <> tdf.Connect Then ' refresh link
e(Mid(tdf.Connect, 11)).Name
tdf.Connect = strConnect tdf.RefreshLink Else ' Force an error message to appear in the case if back-end is moved ' to another directory strTst = DBEngine(0).OpenDataba
s End If Else On Error GoTo smsTrickyAutoRefreshLink_Err End If End If Next smsTrickyAutoRefreshLink = True smsTrickyAutoRefreshLink_Exit: SysCmd acSysCmdClearStatus DoCmd.Hourglass False
AutoRefreshLink = False Resume
smsTrickyAutoRefreshLink = True Exit Function smsTrickyAutoRefreshLink_Err: MsgBox "smsTrickyAutoRefreshLink: " & Err & " - " & _ Err.Description, vbCritical + vbOKOnly, _ "Links Auto Refresher" smsTrick
ysmsTrickyAutoRefreshLink_Exit

End Function

Power-Point: Using only part of a picture in PowerPoint

Using only part of a picture in PowerPoint.

In PowerPoint, you may find a picture you like but only wish to use part of it. To use only a portion of a picture:

  • You must first insert it into your slide.
  • Now, select the picture you want to edit and click Ungroup from the Draw menu.
  • Now, click somewhere on the slide aside from the picture, and then click on an object in the picture you wish to delete and press Delete.

Power-Point:Using AVI files with presentations

Using AVI files with presentations.

Using an AVI file with a presentation may spice it up, but it can also ruin it. Make sure to keep your AVI file normal size. A movie playing that is viewed too big will not have anywhere near the quality that a smaller viewed movie will.

Power Point :Resizing text that is grouped with a picture

Resizing text that is grouped with a picture.

In PowerPoint you can group a picture with text. If you a text in a text box, the problem with this is that when you resize the picture, the text’s size doesn’t change. To change the size of the text:

  • Select the text you want to alter.
  • Click on Format in the toolbar.
  • Click on Font.
  • From here you can change the size, along with the font and the color.

Click OK when you have made the appropriate changes.

Power-Point:Changing the background color in PowerPoint

Changing the background color in PowerPoint.

You can easily change the background color while working in Microsoft PowerPoint. To do this:

  • From the Format menu, click Background.
  • Make your selections.
  • Click Apply, or Apply to all.

Power-Point:Using graphics with text efficiently

Using graphics with text efficiently.

While working in Microsoft PowerPoint, you may decide to use text over graphics. This can either make or break your presentation, depending on how well you select your font and color. When working with text and a full color, it can be very difficult to pick the right color and font style. However, when working with a picture that only contains a few colors, text on top of it can spice up the slide’s appearance.

Power-Point: Using layers in PowerPoint

Using layers in PowerPoint.

While working in PowerPoint, putting things such as the background and text in layers may make working with a slide less difficult.

Power-point: Resizing pictures.

Resizing pictures.

You can size pictures in PowerPoint by clicking the picture with the mouse and dragging it to a new size. If you don't want to "stretch" the picture (keeping the horizontal aspect ratio the same) but enlarge it, hold the Crtl key when changing the size. You can also click the corner of the picture and enlarge it and the aspect ratio will remain the same.

Power Point:Keeping pictures and artwork in proportion.

Keeping pictures and artwork in proportion.

When resizing elements in PowerPoint, you want to size them so that all the elements remain the same size in relationship with each other. You can do this by making sure that when you're resizing something, that you are resizing everything at once. For example, if you have four pictures that you have to resize, but they have to stay the same size in relation to each other,

  • You click the first picture.
  • Hold down the Shift key.
  • Click the other three pictures.
  • Then you mouse drag the picture to the size you want.

MS Power-Point:Easily Changing from Caps to Lower Case

Easily Changing from Caps to Lower Case (or Vice Versa)

 If you have text that is in the wrong case, select the text, and then click Shift+F3 until it changes to the case style that you like. Clicking Shift+F3 toggles the text case between ALL CAPS, lower case, and Initial Capital styles. You'll be surprised how often you use this once you get the hang of it!

Nudging Objects

 You can use the arrow keys to move objects very small distances. This is a big win for those laptop users who no longer have mice. Select the object, then use your arrow keys. Each press of the key will move the object on "grid unit" (1/12th of an inch, don't ask why); if you hold down the ALT key while nudging, or if you have the grid turned off, you can move the objects one pixel at a time.

Saving Across Multiple Diskettes

 From the File menu, select Pack and Go. This wizard will compress your PowerPoint presentation and copy the file onto as many floppies as are necessary.  Be sure to format a bunch of floppies BEFORE you start the process, and make sure they are empty.  This feature requires PowerPoint 95 or higher.

Subliminal Messages

These can be pretty hysterical in the right circumstances. Create a text object. With the text object selected, click on the Animation Effects button on the tool bar (the one that looks like a yellow star), and then click on the "flash once" button. Go to slide show and see the message quickly flash and then disappear.

Editing Drawings

Anything you draw with the pencil tool, you can edit. To get the object into "points mode", either double-click on the object, or select it then hit the Enter key. You will then see points at every vertex, which you can move. You can add points by holding down the shift key and clicking, you can subtract points by holding down the ALT key while clicking, and you can of course just drag points around.

MS pPower-Point: Building Presentations for Distribution to Others

Building Presentations for Distribution to Others

  If you're making a PowerPoint presentation that you intend to distribute to lots of different people, here are some important things to watch out for that will cause problems:

1. Stick with the fonts that come installed with Windows; Fancy fonts that appear on your machine will cause problems if everyone else doesn't have them.

2. Avoid embedding sounds and videos: these will not go from Mac to Windows gracefully, and you have to be very careful about how you insert the files in order to get them to "travel" properly. See the FAQ section for more information on this.

3. Try looking at the presentation on a different platform (Mac vs Windows); be prepared for some visual changes in your file--the version or platform may not support some of the features you've put in, so be sure to sanity check your file on several different machines and versions BEFORE you distribute it!

Making Presentation Files Smaller

Making Presentation Files Smaller

 Prior to PowerPoint 97, there was no internal file compression code inside of PowerPoint, and files could get pretty big quickly. The most common cause of large files is the addition of large bitmaps. PowerPoint 97 compresses these bitmaps, but previous versions do not. To keep your presentations as small as you can, try reducing the resolution of your bitmaps, which will bring their size down tremendously. For viewing on screen, the bitmaps don't need to be more than 96 dpi; they won't print nicely until they're up around 150 or higher, but the screen always displays at 96 dpi, so if the primary viewing medium is the screen, there's no point in having the bitmaps be a higher resolution. Also, the bitmap format can make a big difference to your file sizes. JPEG and PNG both have good internal compression code. GIF has some, but not as good as JPEG. BMP files are the largest; TIFF files will also be very large.

Sometimes, as you're working on a presentation, you'll notice that the file seems to get bigger for no reason.  To get rid of this "bloating", save the file using "File/Save As" and give the file a new name.  This can reduce the file size up to 50%.

MS Power-Point:Setting the Default Text Style

Setting the Default Text Style

 If you want to change the style of the text that appears when you type things that aren't the title or the slide body, do the following:
Make sure no objects are selected.
From the Format menu, select Font. Make all the changes that you want there, and click OK.
From that point on, new text will be created in that style.

To Set the formatting for the title or slide body objects, go to the Slide Master and format these objects on the master.

MS Power-Point:Making Slides Print Correctly

Making Slides Print Correctly

PowerPoint has certain defaults to determine how it prints each object on the page.  You can see over-ride these defaults.  Go to View/Black and White; this will show you a gray-scale preview of how your slide will print.  To change the print settings for any given object, right-click on it, then click "Black and White", and then choose the appropriate print option for that object.  Master objects can be selected by going to the Master page View

MS Power Point :Preview Fonts in the Toolbar

Preview Fonts in the Toolbar

If you'd like to see previews of the actual fonts in the font selection of the formatting toolbar, go to Tools/Customize, click on the Options tab, and click "List font names in their font", click Close.

MS Power-Point:Getting Rid of Short Menus

Getting Rid of Short Menus

Forgetting user reaction to this feature when it was introduced in Word years ago, the Office team decided to try it again.  Unfortunately, it's still annoying.  To see all of your options when you click on menus, go to Tools/Customize, click on the Options tab, and uncheck "menus show recently used commands"

MS Power Point :Displaying Keyboard Shortcuts in Tool Tips

Displaying Keyboard Shortcuts in Tool Tips

If you'd like to see the available keyboard shortcuts for menus, commands, and toolbar buttons, go to Tools/Customize, click on the Options tab, and click on "show shortcut keys in screen tips". 

Saving Your Toolbar Configurations

Saving Your Toolbar Configurations

If you like to customize your UI, move toolbars around, configure toolbars, etc, then you'll want to know that all this information is stored in c:\windows\application data\microsoft\powerpoint\ppt.pcb

By copying this file, you can move your customizations to other machines

MS Power-Point:Save Your Fonts with Your Presentation

Save Your Fonts with Your Presentation

If you're preparing a presentation that you plan to distribute to others, be sure that you check this option by clicking on the Tools button in the File/Save As dialog box.  This will work for most TrueType fonts on the Windows platform.