I created an application in Access 2003 and continued to work on it on another computer with Access 2007. I created a report with a method that loads data from a recordset to some unbound fields on the report. This method takes three parameter values from three fields on the report. The report's data source is a query.
I call the method in the report's Load() event, like LoadSummary([field1],[field2],[field3]) and works fine in Access 2007.
I switched back to Access 2003 and the Load event is unavailable. I've tried calling the method using the Open, Page and Activate events but all fail because it seems like when these events fire, the fields have not been populated with the data yet.
Please help. How can I get this to work in Access 2003? Any eye openers are welcome. Thanks.
Try the OnFormat event of the report header section. If that doesn't work try the detail sections OnFormat event but but in a report level boolean variable so it only does it once.
Related
I have an ms Access form that is linked to query.
The query depends on a control on another form to filter the data
I set the view of the form to be Data Sheet View to have the capabilities of filtering and sorting.
The form at start responds to the Requery command correctly.
When filter is applied to the data it keeps responding to the Requery command
When the filter is removed it stops responding to the Requery command. Command is executed normally without any error but displayed data doesn't respond to the change.
I run the underlying query at the same time and it responds well.
When applying any filter again the response returns to normal again
Do any one have a clue about this problem?
I am using Ms Access 2019 64bit (integrated with Office 365 package)
Here is sample database link to clarify the problem. Run frmMain and follow the steps on the right to replicate the problem
DemoDB
For anybody dropping here I had an answer from Microsoft Community as follows (related to shared demo sample):
Change the code for the button Check8 to:
Private Sub Check8_Click()
If Me.frmSubSub.Form.Filter = "" Then
frmSubSub.Form.RecordSource = frmSubSub.Form.RecordSource
Else
frmSubSub.Form.Requery
End If
End Sub
This worked fine for me despite the demo shows there is a bug in MsAccess to deal with this situation.
Link to question on MS Community: Link
In an application I have two ribbons: a "General" one which is used for all forms, and a reports-specific one for all reports. From a "Reports Manager" style form, a user can select a report and preview it.
When the report opens, it correctly displays the Reports Ribbon. However, when the report is closed, the Reports Manager form is still showing the Reports Ribbon, instead of the general one.
Once this form is closed, the Ribbon changes back to the general one.
Note that users access this application, as an accde, via Terminal Server.
This incorrect behaviour does NOT happen on a local development machine, so I suspect it is due to a TS 'refresh' issue - which I have noticed in a couple of other circumstances.
Is there anyway to 'force' a refresh of the Ribbon when a report is closed, and the Reports Manager form is therefore displayed?
I would consider in your startup code grabbing a handle to the main ribbon (that is not re-displaying). Then in the reports on-close event execute a ribbon invalidate command like this:
MyMainRibbon.Invalidate
So you can “force” a ribbon re-plot. This does suggest you always use a accDE, since with a accDB then any un-handed error will ALSO lose the above global var that holds a reference to the ribbon.
So, I built a form in Access 2007, and put a subform on it. Then I went to the Property Sheet for one of the controls on the subform and used the builder to point to Code Builder for the OnClick event. This opened the VBA editor & inserted a sub skeleton. I added code here (just a freakin' MsgBox, so far), saved & tried running (opening) the form. It looks good, but clicking the control that has event code yields this, immediately:
The expression On Click you entered as the event property setting produced the following error: A problem occurred while Microsoft Access as communicating with the OLE server of ActiveX Control.
The so-called Help on the error notification is completely useless. It reads:
This error occurs when an event has failed to run because Microsoft Office Access cannot evaluate the location of the logic for the event. For example, if the OnOpen property of a form is set to =[Field], this error occurs because Access expects a macro or event name to run when the event is fired.
Access knew what was going on at design time, since it dropped me into VBA. The Property Sheet entry does read "[Event Procedure]". Is there a secret ninja trick to handling events from a subform, or is it just not possible?
I deleted the problem subform & created a new one. This one seems to work as expected. Go figure....
I am working on an Access 2007 application that was created by someone else. It has a strange, intermittent bug in which it prompts the user for query parameters when the main form is opened. The query parameters are clearly not necessary, because the error does not always occur.
The very strange "fix" to this problem is to open and close a particular module before opening the main form. Then the form opens without parameter prompts. However, of course I can't ask end users to open and close modules.
I tried using a macro to open and close the module when the database is opened. That fixes the bug, but leaves the VBA code window open, so that's no good.
Has anyone run into anything like this before? Any suggested solutions, workarounds, debugging tips, etc?
If you use the "Database Documenter" feature and check "yes" to all the options, you will obtain an exhaustive report that should let you trap your problem parameter. Export this report as an .rtf or .pdf document, so it is searchable. Identify a keyword from the dialog prompt, and search on that.
Once you check the query objects using the Documenter, check your VBA code. You'll do this by stepping through code in the IDE. If the main form has subforms, they are opened with (within) the main form. And they load before the main form.
Identify those subforms.
Sprinkle
breakpoints in their code modules
(if you find a Load function, that
is highly relevant).
If the main form has a
code module, do the same there.
Have a look for global variables in the module that needs to be opened and closed or any variable that is referenced in the module belonging to the form.
Access displays the Enter Parameter Value dialog box when you open an object that contains an identifier or expression that Access cannot interpret. You need to determine the source object. Here's a step-by-step guide:
http://office.microsoft.com/en-us/access-help/why-does-access-want-me-to-enter-a-parameter-value-HA010274377.aspx
I have Office 2003.
I would like to create Commandbar with timer in MS Access using VBA.
What I want is on ever half a second command bar button gets the name of active forms and lists name of forms.
How can I do that?
You can create a CommandBar using a Macro object in Excel 2003. However, needing to update it every 1/2 second is complete overkill. Forms won't get added or dropped very frequently, so you should have a static list for both performance and maintenance reasons.
The best way is to actually make a custom menu (an AddMenu line in the Autoexec macro) that calls a different macro with all the menu entries in it. Actual command bars require a good amount of VB to make them work properly.