Changing icon on Microsoft Access database - ms-access

This has been driving me crazy, and I really don't understand why it doesn't work...
I am trying to change the icon for my Access database using VBA, and it /almost/ works.
I am using the following code in the OnOpen event of my startup form:
CurrentDb.Properties("AppIcon").Value = CurrentProject.Path & "\favicon.ico"
CurrentDb.Properties("UseAppIconForFrmRpt").Value = True
Application.RefreshTitleBar
The icon shows up in the titlebar and main Access window just fine, however, the icon does NOT show up on forms. The weird thing is: It DOES show up on reports. Can anyone fill me in on what the H is going on? Thank you in advance!

Related

Runtime Error 6054 referencing all docmd.browseto Navigation subform pathways all of a sudden

HELP Please...
All of sudden all of the VBA docmd.browseto code within the entire navigation form has been producing a runtime error 6054 referencing issues with the pathway. These lines of code have worked for months and then all of a sudden stopped working. They work in a backup version from a few days ago when I open it now. I cant figure it out. As far as I can tell the pathways are accurate. I havent changed them, nor have I renamed the main navigation form.
navigation form = frmNavigation example of navigationsubform = frmNewServiceSession
‘DoCmd.BrowseTo acBrowseToForm, "frmnewclientsinfo", "frmNavigation.navigationsubform", , , acFormEdit’
.... regardless of what navigation subform I reference I get the same error code. Again, this worked fine earlier.
Edit*** To test things a bit I had imported frmNavigation and frmNewServiceSession into my most recent backup and they communicate just fine using the exact vba as above.... Something strange is going on
I figured out what was happening although I dont exactly know why. Open to insight, but resolved the immediate issue.
Resolution:
I use to have a Timer form open hidden on autoexec but moved it an action within the Login form on OK button click. For some reason that difference messed with all of the BrowseTo functions.
Thanks

Microsoft Access 2013 Button Issue

I have kind of a two part issue (they may be related, I'm not sure). I've never worked with Microsoft Access 2013 before (or any Access version really), and using a "for dummies" type book I'm trying to build a front end interface to link to a SQL database. To do this I'm using the navigation form, regular forms, and then the tables themselves in subforms within that. The forms that hold the subforms are also where I'm placing my buttons. My intentions with these buttons are to use them to filter the table to specific records. I have one doing that successfully (via the main navigation form) but then I have the problem of all the other buttons not working at all, or calling the same text box that that one calls.
This is the code to the working button:
I added the stop Macros actions in an effort to keep the same box from popping up when I pressed another button that houses the macro with a show all records action. Because of issues I also added a stop macro action before the show all records actions on this button (I would do a picture but I'm only allowed two links per the site rules).
This one I found when I added the stop action to the macro before the show all action it stopped the box from popping up, but it also doesn't work to show me all the records. Without the stop action, it acts exactly like the Search Mill ID Button.
The second part of my issues is that my third button currently does show me all records despite it being me trying to use it as a search feature to have a box pop up and the user enter in all or part of a company name to filter the records.
That code looks like this:
I am pretty sure there are a few things wrong with the code on this button in general, but have been having trouble finding any resources of people who are having the same problems as me (or perhaps the issue is so basic most users just automatically know what to do). I've been relying on youtube videos and an access for dummies book to try to build this stuff, but realize that I'm a little beyond my skills; however, I still have to get it done for my job so I'm persevering through.
I appreciate any tips/suggestions to help!
One approach would be to set the OnClick event of your button to use VBA code (Event Procedure), and get the Mill_Id from an Input Box. Macros are much more limiting than VBA and you cannot reasonably use error handling. You can then set the RecordSource property of the form when the button is clicked. The buttons OnClick event would be something like this:
Private Sub Command0_Click()
s = InputBox("What is the Mill ID?", "Mill ID", "")
Me.RecordSource = "SELECT * FROM MyTableWithMillData WHERE Mill_ID = '" & s & "'"
End Sub
Or if the button is on a parent form, and you're trying to change the subform, use this:
Private Sub Command0_Click()
s = InputBox("What is the Mill ID?", "Mill ID", "")
Me!subformcontrolname.Form.RecordSource = "SELECT * FROM MyTableWithMillData WHERE Mill_ID = '" & s & "'"
End Sub

Zoom in on a report

I am trying to build a pop up zoom in form which will zoom in on a report embedded in a tab control embedded in a form. My zoom in box control is called txtzoom. The code i thought would work looks like the following
Private Sub Form_Open(Cancel As Integer)
Me.txtZoom = Forms("frmContactsSwitchboard").Report("rptContactPage05")!Note
End Sub
My plan is to be able to zoom into a field, and be able to edit it.. I am not sure if this is possible.
I would appreciate if someone who is familiar with this issue could please let me know what i can do to resolve it..
Cheers,
A
Do you know about Access's built-in (but flawed) Zoom window? Try pressing Shift-F2 on a table, query, form, or report (in report view). Unfortunately, the font defaults to Tahoma 8pt and resets each time you close Access. So, the first Shift-F2 doesn't help much, but once you've changed the font size, the rest of the functionality is there. You may want to just give the user a label that suggests using Shift-F2 to zoom.

Problems implementing basic VBA in Access 2007

I'm trying to write some code for my database to enable a dropdown box in a parameter prompt for a query, but it's doing nothing instead of it's intended purpose. This:
Dropdown in Access 2007 parameter query
has been the source of my inspiration. Though I seem to be unable to implement even the most basic VBA code:
Private Sub cmdReset_Click()
Me.cboSelectName = Null
End Sub
(Yes this is not all my code! Just one of the subs)
On the relevant form, I have a button called "cmdReset", which has "[Event Procedure]" for the event "On-Click". I also have a dropdown box called "cboSelectName" on said form. Also I have tried closing the database, and making sure to enable macros when it starts.
So essentially this code should make the value in the dropdown box null when I click the reset button. However it does nothing, it simply deselects the dropdown box. Can anyone help me with this one? I'm keen to start implementing some VBA in my database!
As suggested by Remou, the code wasn't even running. I figured out my problem - I had saved the code in a new module, rather than in the VBA code for my form. Once I shifted the code into the form object, the reset button worked. I've also now got some nifty code working with the actual "generate report" command. VBA really has the power to take your database to a whole new level!

MS Access 2003/2007 - Chart Object on a sub form, not loading when parent forms load

SO I have a subform, that simply has one chart object on it. Its small, and this is the only purpose of this sub. Then I have about 10 forms that each have a sub windows with this form as it's child. I use a UNION query to show the current balance of 10 accounts on each form with this chart for comparative purposes. Everything works fine except for one small thing...
when you open any of these forms, you have to take your mouse over to the actual sub window and click inside of it to get the chart to show. once you do it works fine, on any and all forms, but this same issue if recurring on all these forms as well, so I am sure I am missing something here??
Any ideas about this one?
thanks
Justin
I think you can work this out by not using a subform, but rather a chart control directly inserted in the form. I know it can be a headache to design a chart control in every form, but by doing it, you can control directly the data source of the chart independently from any other form.
Example:
I will suppose that you need to update the chart after updating a text box (txtExample).
You can alter the data source of the control usint the afterUpdate event:
Private Sub txtExample_AfterUpdate()
chart1.RowSource = "SELECT ... FROM ..."
chart1.Requery
End Sub
The RowSource property of the chart object will be altered and updated every time the value of the text box is updated.
Hope this works for you
I have looked around for this problem and found that me.graph1.requery doesn't help in my 2003 version. I did try in desperation this: docmd.requery (Graph1) that crashes but when you put on error resume next it does show the graph everytime! True Microsoft style I guess to fix it with another buggy thing.