Refreshtitlebar

  • Thread starter Thread starter Dale Brown
  • Start date Start date
D

Dale Brown

I have code that I am using to change the title bars description and the
application icon. I had this working at one time but I am on a new
machine. It is not working now. The code for the button to do this is
below. Any help would be appreciated.

On Error GoTo act_Error
Me.Recalc
GoTo act_Resume
act_Error:
MsgBox "Please complete this record before attempting to activate
this show."
Resume act_Resume
act_Resume:
On Error GoTo 0
DoCmd.SetWarnings False
DoCmd.RunSQL "delete * from activeshow"
DoCmd.RunSQL "insert into activeshow(showid) values (" & ShowID & ")"

Dim dbs As Database
Set dbs = CurrentDb

Dim rs As Recordset
Dim showDesc As String
showDesc = "GaitKeeper"
Set rs = dbs.OpenRecordset("select * from activeshowinfo")
If (Not rs.EOF And Not rs.BOF) Then
showDesc = showDesc & ": " & rs("showdescription")
End If
rs.Close

dbs.Properties("AppTitle") = showDesc
dbs.Properties("AppIcon") = "gkred.ico"
RefreshTitleBar

Dim frm As Form
Dim ex As Integer
For Each frm In Forms
If (Not frm.Name = "showSetup") Then
DoCmd.Close acForm, frm.Name
End If
Next frm

Dim rpt As Report
For Each rpt In Reports
DoCmd.Close acReport, rpt.Name
Next rpt
End Sub
 
Hi Dale,

To change the application title and application icon, we can try the code
like below:

Dim dbs As DAO.Database

Set dbs = CurrentDb

' Change title bar.
dbs.Properties("AppTitle") = "Hello Word!"
dbs.Properties("AppIcon") = "c:\earch.ICO"

' Update title bar on screen.
Application.RefreshTitleBar

Please note the property named AppIcon is only available when we set the
Application Icon in the Startup dialog box. If we leave the Application
Icon item empty in the Startup option, this property is not available in
the CurrentDB.Properties collection.

Please feel free to reply to the threads if you have any concerns or
questions.



Sincerely,

Alick Ye, MCSD
Product Support Services
Microsoft Corporation
Get Secure! - <www.microsoft.com/security>

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| Message-ID: <[email protected]>
|
| I have code that I am using to change the title bars description and the
| application icon. I had this working at one time but I am on a new
| machine. It is not working now. The code for the button to do this is
| below. Any help would be appreciated.
|
| On Error GoTo act_Error
| Me.Recalc
| GoTo act_Resume
| act_Error:
| MsgBox "Please complete this record before attempting to activate
| this show."
| Resume act_Resume
| act_Resume:
| On Error GoTo 0
| DoCmd.SetWarnings False
| DoCmd.RunSQL "delete * from activeshow"
| DoCmd.RunSQL "insert into activeshow(showid) values (" & ShowID & ")"
|
| Dim dbs As Database
| Set dbs = CurrentDb
|
| Dim rs As Recordset
| Dim showDesc As String
| showDesc = "GaitKeeper"
| Set rs = dbs.OpenRecordset("select * from activeshowinfo")
| If (Not rs.EOF And Not rs.BOF) Then
| showDesc = showDesc & ": " & rs("showdescription")
| End If
| rs.Close
|
| dbs.Properties("AppTitle") = showDesc
| dbs.Properties("AppIcon") = "gkred.ico"
| RefreshTitleBar
|
| Dim frm As Form
| Dim ex As Integer
| For Each frm In Forms
| If (Not frm.Name = "showSetup") Then
| DoCmd.Close acForm, frm.Name
| End If
| Next frm
|
| Dim rpt As Report
| For Each rpt In Reports
| DoCmd.Close acReport, rpt.Name
| Next rpt
| End Sub
|
|
 
Alick,

I have changed my code slightly to include the DAO before the database
for dbs and changed the refreshtitlebar to Application.RefreshTitleBar.
It still does not work. I do have the application icon set at the
startup like you indicated. Any other suggestions.

Dale
 
Hi Dale,

Would you please follow the steps below and let me know the result?

1. Create a new blank database file.
2. Create a new form with one button.
3. On the button click event, copy and paste the code below;
Note: I assume your ico file is in c:\earch.ICO

Dim dbs As DAO.Database

Set dbs = CurrentDb

' Change title bar.
dbs.Properties("AppTitle") = "Hello Word!"
dbs.Properties("AppIcon") = "c:\earch.ICO"

' Update title bar on screen.
Application.RefreshTitleBar

4. Click tools->Startup, enter some valid ico resource in the application
icon text box.
5. Click OK out.
6. Restart the new database file.
7. Run the form, click the button. Does it work?

Note: you may need to check Microsoft DAO 3.6 Object library if it is not
selected.

Please feel free to reply to the threads if you have any questions or
concerns.



Sincerely,

Alick Ye, MCSD
Product Support Services
Microsoft Corporation
Get Secure! - <www.microsoft.com/security>

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Message-ID: <[email protected]>
| Date: Tue, 04 Nov 2003 08:16:12 -0600
|
| Alick,
|
| I have changed my code slightly to include the DAO before the database
| for dbs and changed the refreshtitlebar to Application.RefreshTitleBar.
| It still does not work. I do have the application icon set at the
| startup like you indicated. Any other suggestions.
|
| Dale
|
| Alick [MSFT] wrote:
| > Hi Dale,
| >
| > To change the application title and application icon, we can try the
code
| > like below:
| >
| > Dim dbs As DAO.Database
| >
| > Set dbs = CurrentDb
| >
| > ' Change title bar.
| > dbs.Properties("AppTitle") = "Hello Word!"
| > dbs.Properties("AppIcon") = "c:\earch.ICO"
| >
| > ' Update title bar on screen.
| > Application.RefreshTitleBar
| >
| > Please note the property named AppIcon is only available when we set
the
| > Application Icon in the Startup dialog box. If we leave the Application
| > Icon item empty in the Startup option, this property is not available
in
| > the CurrentDB.Properties collection.
| >
| > Please feel free to reply to the threads if you have any concerns or
| > questions.
| >
| >
| >
| > Sincerely,
| >
| > Alick Ye, MCSD
| > Product Support Services
| > Microsoft Corporation
| > Get Secure! - <www.microsoft.com/security>
| >
| > This posting is provided "AS IS" with no warranties, and confers no
rights.
| >
| >
| > --------------------
| > | Message-ID: <[email protected]>
| > |
| > | I have code that I am using to change the title bars description and
the
| > | application icon. I had this working at one time but I am on a new
| > | machine. It is not working now. The code for the button to do this is
| > | below. Any help would be appreciated.
| > |
| > | On Error GoTo act_Error
| > | Me.Recalc
| > | GoTo act_Resume
| > | act_Error:
| > | MsgBox "Please complete this record before attempting to
activate
| > | this show."
| > | Resume act_Resume
| > | act_Resume:
| > | On Error GoTo 0
| > | DoCmd.SetWarnings False
| > | DoCmd.RunSQL "delete * from activeshow"
| > | DoCmd.RunSQL "insert into activeshow(showid) values (" & ShowID
& ")"
| > |
| > | Dim dbs As Database
| > | Set dbs = CurrentDb
| > |
| > | Dim rs As Recordset
| > | Dim showDesc As String
| > | showDesc = "GaitKeeper"
| > | Set rs = dbs.OpenRecordset("select * from activeshowinfo")
| > | If (Not rs.EOF And Not rs.BOF) Then
| > | showDesc = showDesc & ": " & rs("showdescription")
| > | End If
| > | rs.Close
| > |
| > | dbs.Properties("AppTitle") = showDesc
| > | dbs.Properties("AppIcon") = "gkred.ico"
| > | RefreshTitleBar
| > |
| > | Dim frm As Form
| > | Dim ex As Integer
| > | For Each frm In Forms
| > | If (Not frm.Name = "showSetup") Then
| > | DoCmd.Close acForm, frm.Name
| > | End If
| > | Next frm
| > |
| > | Dim rpt As Report
| > | For Each rpt In Reports
| > | DoCmd.Close acReport, rpt.Name
| > | Next rpt
| > | End Sub
| > |
| > |
| >
|
|
 
This has been resolved.
The applications icon file was in the wrong location.
Moving it was the resolution.
Evidently since the icon file could not be located that prevented the title
bar update.

--
David Bartosik - Microsoft MVP
Visit www.davidbartosik.com
for Publisher and Web Design
Tips and How-to's.


Alick said:
Hi Dale,

Would you please follow the steps below and let me know the result?

1. Create a new blank database file.
2. Create a new form with one button.
3. On the button click event, copy and paste the code below;
Note: I assume your ico file is in c:\earch.ICO

Dim dbs As DAO.Database

Set dbs = CurrentDb

' Change title bar.
dbs.Properties("AppTitle") = "Hello Word!"
dbs.Properties("AppIcon") = "c:\earch.ICO"

' Update title bar on screen.
Application.RefreshTitleBar

4. Click tools->Startup, enter some valid ico resource in the application
icon text box.
5. Click OK out.
6. Restart the new database file.
7. Run the form, click the button. Does it work?

Note: you may need to check Microsoft DAO 3.6 Object library if it is not
selected.

Please feel free to reply to the threads if you have any questions or
concerns.



Sincerely,

Alick Ye, MCSD
Product Support Services
Microsoft Corporation
Get Secure! - <www.microsoft.com/security>

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Message-ID: <[email protected]>
| Date: Tue, 04 Nov 2003 08:16:12 -0600
|
| Alick,
|
| I have changed my code slightly to include the DAO before the database
| for dbs and changed the refreshtitlebar to Application.RefreshTitleBar.
| It still does not work. I do have the application icon set at the
| startup like you indicated. Any other suggestions.
|
| Dale
|
| Alick [MSFT] wrote:
| > Hi Dale,
| >
| > To change the application title and application icon, we can try the
code
| > like below:
| >
| > Dim dbs As DAO.Database
| >
| > Set dbs = CurrentDb
| >
| > ' Change title bar.
| > dbs.Properties("AppTitle") = "Hello Word!"
| > dbs.Properties("AppIcon") = "c:\earch.ICO"
| >
| > ' Update title bar on screen.
| > Application.RefreshTitleBar
| >
| > Please note the property named AppIcon is only available when we set
the
| > Application Icon in the Startup dialog box. If we leave the Application
| > Icon item empty in the Startup option, this property is not available
in
| > the CurrentDB.Properties collection.
| >
| > Please feel free to reply to the threads if you have any concerns or
| > questions.
| >
| >
| >
| > Sincerely,
| >
| > Alick Ye, MCSD
| > Product Support Services
| > Microsoft Corporation
| > Get Secure! - <www.microsoft.com/security>
| >
| > This posting is provided "AS IS" with no warranties, and confers no
rights.
| >
| >
| > --------------------
| > | Message-ID: <[email protected]>
| > |
| > | I have code that I am using to change the title bars description and
the
| > | application icon. I had this working at one time but I am on a new
| > | machine. It is not working now. The code for the button to do this is
| > | below. Any help would be appreciated.
| > |
| > | On Error GoTo act_Error
| > | Me.Recalc
| > | GoTo act_Resume
| > | act_Error:
| > | MsgBox "Please complete this record before attempting to
activate
| > | this show."
| > | Resume act_Resume
| > | act_Resume:
| > | On Error GoTo 0
| > | DoCmd.SetWarnings False
| > | DoCmd.RunSQL "delete * from activeshow"
| > | DoCmd.RunSQL "insert into activeshow(showid) values (" & ShowID
& ")"
| > |
| > | Dim dbs As Database
| > | Set dbs = CurrentDb
| > |
| > | Dim rs As Recordset
| > | Dim showDesc As String
| > | showDesc = "GaitKeeper"
| > | Set rs = dbs.OpenRecordset("select * from activeshowinfo")
| > | If (Not rs.EOF And Not rs.BOF) Then
| > | showDesc = showDesc & ": " & rs("showdescription")
| > | End If
| > | rs.Close
| > |
| > | dbs.Properties("AppTitle") = showDesc
| > | dbs.Properties("AppIcon") = "gkred.ico"
| > | RefreshTitleBar
| > |
| > | Dim frm As Form
| > | Dim ex As Integer
| > | For Each frm In Forms
| > | If (Not frm.Name = "showSetup") Then
| > | DoCmd.Close acForm, frm.Name
| > | End If
| > | Next frm
| > |
| > | Dim rpt As Report
| > | For Each rpt In Reports
| > | DoCmd.Close acReport, rpt.Name
| > | Next rpt
| > | End Sub
| > |
| > |
| >
|
|
 
Glad to hear it was resolved. :- )


Sincerely,

Alick Ye, MCSD
Product Support Services
Microsoft Corporation
Get Secure! - <www.microsoft.com/security>

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Reply-To: "David Bartosik - MS MVP" <[email protected]>
| X-Tomcat-NG: microsoft.public.access.forms
|
| This has been resolved.
| The applications icon file was in the wrong location.
| Moving it was the resolution.
| Evidently since the icon file could not be located that prevented the
title
| bar update.
|
| --
| David Bartosik - Microsoft MVP
| Visit www.davidbartosik.com
| for Publisher and Web Design
| Tips and How-to's.
|
|
| | > Hi Dale,
| >
| > Would you please follow the steps below and let me know the result?
| >
| > 1. Create a new blank database file.
| > 2. Create a new form with one button.
| > 3. On the button click event, copy and paste the code below;
| > Note: I assume your ico file is in c:\earch.ICO
| >
| > Dim dbs As DAO.Database
| >
| > Set dbs = CurrentDb
| >
| > ' Change title bar.
| > dbs.Properties("AppTitle") = "Hello Word!"
| > dbs.Properties("AppIcon") = "c:\earch.ICO"
| >
| > ' Update title bar on screen.
| > Application.RefreshTitleBar
| >
| > 4. Click tools->Startup, enter some valid ico resource in the
application
| > icon text box.
| > 5. Click OK out.
| > 6. Restart the new database file.
| > 7. Run the form, click the button. Does it work?
| >
| > Note: you may need to check Microsoft DAO 3.6 Object library if it is
not
| > selected.
| >
| > Please feel free to reply to the threads if you have any questions or
| > concerns.
| >
| >
| >
| > Sincerely,
| >
| > Alick Ye, MCSD
| > Product Support Services
| > Microsoft Corporation
| > Get Secure! - <www.microsoft.com/security>
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| >
| > --------------------
| > | Message-ID: <[email protected]>
| > | Date: Tue, 04 Nov 2003 08:16:12 -0600
| > |
| > | Alick,
| > |
| > | I have changed my code slightly to include the DAO before the database
| > | for dbs and changed the refreshtitlebar to
Application.RefreshTitleBar.
| > | It still does not work. I do have the application icon set at the
| > | startup like you indicated. Any other suggestions.
| > |
| > | Dale
| > |
| > | Alick [MSFT] wrote:
| > | > Hi Dale,
| > | >
| > | > To change the application title and application icon, we can try the
| > code
| > | > like below:
| > | >
| > | > Dim dbs As DAO.Database
| > | >
| > | > Set dbs = CurrentDb
| > | >
| > | > ' Change title bar.
| > | > dbs.Properties("AppTitle") = "Hello Word!"
| > | > dbs.Properties("AppIcon") = "c:\earch.ICO"
| > | >
| > | > ' Update title bar on screen.
| > | > Application.RefreshTitleBar
| > | >
| > | > Please note the property named AppIcon is only available when we set
| > the
| > | > Application Icon in the Startup dialog box. If we leave the
| Application
| > | > Icon item empty in the Startup option, this property is not
available
| > in
| > | > the CurrentDB.Properties collection.
| > | >
| > | > Please feel free to reply to the threads if you have any concerns or
| > | > questions.
| > | >
| > | >
| > | >
| > | > Sincerely,
| > | >
| > | > Alick Ye, MCSD
| > | > Product Support Services
| > | > Microsoft Corporation
| > | > Get Secure! - <www.microsoft.com/security>
| > | >
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > rights.
| > | >
| > | >
| > | > --------------------
| > | > | Message-ID: <[email protected]>
| > | > |
| > | > | I have code that I am using to change the title bars description
and
| > the
| > | > | application icon. I had this working at one time but I am on a
new
| > | > | machine. It is not working now. The code for the button to do this
| is
| > | > | below. Any help would be appreciated.
| > | > |
| > | > | On Error GoTo act_Error
| > | > | Me.Recalc
| > | > | GoTo act_Resume
| > | > | act_Error:
| > | > | MsgBox "Please complete this record before attempting to
| > activate
| > | > | this show."
| > | > | Resume act_Resume
| > | > | act_Resume:
| > | > | On Error GoTo 0
| > | > | DoCmd.SetWarnings False
| > | > | DoCmd.RunSQL "delete * from activeshow"
| > | > | DoCmd.RunSQL "insert into activeshow(showid) values (" &
ShowID
| > & ")"
| > | > |
| > | > | Dim dbs As Database
| > | > | Set dbs = CurrentDb
| > | > |
| > | > | Dim rs As Recordset
| > | > | Dim showDesc As String
| > | > | showDesc = "GaitKeeper"
| > | > | Set rs = dbs.OpenRecordset("select * from activeshowinfo")
| > | > | If (Not rs.EOF And Not rs.BOF) Then
| > | > | showDesc = showDesc & ": " & rs("showdescription")
| > | > | End If
| > | > | rs.Close
| > | > |
| > | > | dbs.Properties("AppTitle") = showDesc
| > | > | dbs.Properties("AppIcon") = "gkred.ico"
| > | > | RefreshTitleBar
| > | > |
| > | > | Dim frm As Form
| > | > | Dim ex As Integer
| > | > | For Each frm In Forms
| > | > | If (Not frm.Name = "showSetup") Then
| > | > | DoCmd.Close acForm, frm.Name
| > | > | End If
| > | > | Next frm
| > | > |
| > | > | Dim rpt As Report
| > | > | For Each rpt In Reports
| > | > | DoCmd.Close acReport, rpt.Name
| > | > | Next rpt
| > | > | End Sub
| > | > |
| > | > |
| > | >
| > |
| > |
| >
|
|
|
 
Back
Top