How do I change the application icon

D

dougsdir24

Ive written an Access 2000 application and compiled it into an MDE
file which runs on an XP PC using Access 2000 runtime

Tthe icon for MDEs on the XP PC is the Access Key icon with the small
blue padlock, but when i launch my application it loads with a icon
that looks like a white form icon

It can be seen here

http://i17.tinypic.com/435vvro.jpg


how do I change this to one of my own?

TIA

Doug
 
G

Guest

Doug:

Select the Tools | Startup menu item from the main database menu bar. You
can then set the application icon in the dialogue.

In code you can call the following function, passing the path of the icon
file into it as a string expression:

Public Sub ChangeIcon(strIcon As String)

If ChangeProperty("AppIcon", dbText, strIcon) Then
Application.RefreshTitleBar
Else
MsgBox "Unable to change application icon to " & strIcon,
vbExclamation, "Error"
End If

End Sub

The function calls the following general purpose function for changing
database properties:

Public Function ChangeProperty(strPropName As String, varPropType As
Variant, varPropValue As Variant) As Boolean

'General purpose function for changing database properties

Dim dbs As DAO.Database, prp As Property
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Exit:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then 'property not found
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
'unkown error
ChangeProperty = False
Resume Change_Exit
End If

End Function

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top