Modules & VBA :: Error When Executing OnOpen Report?

Sep 8, 2013

I am using ACCESS 2010, win 7 Home Premium 64bit

difficult to handle error when executing my report. I put a code into OnOpen section but ACCESS states:

Quote:

The expression OnOpen you entered as the event property produced the following error: A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX Control.

Additionally it says in description:

This error occurs when an event has failed to run because the location of the logic for the event cannot be evaluated. For example, if the OnOpen property of a form is set to =[Field], this error occurs because a macro or event name is expected to run when the event occurs.

I am genuinely confused by that. I have also provided the code in the case if I am missing something I don't know yet. In a debug window, I have executed the code line by line and it worked. Whenever I try to open the report, the error occurs. Should I be aware of something when I write code for reports?

Below, the code in my report "module":

Code:
Private Sub Report_Open(Cancel As Integer)
Call CreateTempTable
End Sub
Private Sub CreateTempTable()
On Error GoTo ErrorHandler
Dim strTable As String

[code]....

View Replies


ADVERTISEMENT

OnOpen Error With Replicated Database

Apr 15, 2008

I have a replicated databse that is used in both 2003 and 2007. Most development is done in 2003. I have stability problems with replicated/synchronised databases when running in 2007. The database normally opens with a switchboard menu, but on occassions the following error occurs:-
"THE EXPRESSION ON OPEN YOU ENTERED AS THE EVENT PROPERTY SETTING PRODUCED THE FOLLOWING ERROR: OBJECT OR CLASS DOES NOT SUPPORT SET OF EVENTS". Once this happens the databse will not open. I have to create a new replica which may or may not work. The strange thing is that I can run the database failing in 2007 from another rmachine that is running 2003, so it seems that the problem is specfic running 2007. Any suggestions or help would be appreciated.

View 2 Replies View Related

Modules & VBA :: Executing Function Between Business Hours On Weekdays

Sep 13, 2013

What I am trying to do is execute a function M-F every 2 hours between 4am and 6pm. The 2 hour part was easy, I just created a form with a timer, but the other part isn't working so well, here is my latest attempt.

Code:
StrTime = Time()
If Not ((Weekday(Now()) = vbSaturday) Or (Weekday(Now()) = vbSunday)) And (StrTime > "4:00" Or StrTime < "18:00") Then

View 3 Replies View Related

Modules & VBA :: Error 3070 When Opening Report?

Nov 29, 2014

When i run the following code to open my report a receive the following error..

error 3070 the microsoft access database engine does not recognise " as a valid field name or expression

Code:
strDocName = "rptBarcodingMonthly"
MsgBox strDocName
DoCmd.OpenReport strDocName, acViewPreview

The code behind the report - sets on open_report event is the following however i cant see any issues with it as i use it elsewhere..

Code:
' Create underlying recordset for report using criteria entered in
Dim intX As Integer
Dim qdf As QueryDef
Dim frm As Form
' Set database variable to current database.
Set dbsReport = CurrentDb

[code]....

I will also attach a copy of how i set the criteria in the query and the parameters

View 1 Replies View Related

Bypass The OnOpen

Jan 24, 2006

Hi all...

I have a form that OnOpen does;

DoCmd.GoToRecord , , acNewRec

But, I also call it from another form, using a criteria, but because of the OnOpen event within the form it goes to a new record.

I need to be able to bypass the OnOpen event or find a different way of opening the form to goto a new record...

Please help!

Simon

View 1 Replies View Related

Modules & VBA :: Limit Down Report - Keep Getting Runtime Error 3075 Missing Operator

Feb 13, 2015

I have a report I am trying to limit down. I keep getting this error.

Code:

Run-time error '3075':
Syntax error (missing operator) in query expression ' and (Exercise = Barbell Squat)'.

Here is some of my code. What am I missing?

Dim whereCond As String
Forms!frmReports!cmdExercise.SetFocus
Exercise = Forms!frmReports!cmdExercise.Text
Forms!frmReports!cmdCategory.SetFocus
Category = Forms!frmReports!cmdCategory.Text

[Code] ....

View 3 Replies View Related

Drive Verification OnOpen

Oct 19, 2005

Is there a way to verify the drive that an FE is opening from and then close if it is not where is should be?

I have a frontend that gets copied to each users C: drive by a .bat file. However, some just don't care about rules and proceedures and continue to open the frontend on the network drive. Since they map their drive to a specific letter drive for the BE that is where they are opening the FE from.

Thanks
Rich

View 2 Replies View Related

OnOpen Form Event Filter A Combo Box In Subform

Jan 18, 2006

On clicking a button to open a form I want to filter a list in a combo Box located on the forms subform

The main form is called 'Frm_orders'
The sub form is called 'sub'
The combo box field is called 'CostCodeID'
and I want to filter column 0 of the combobox which is Tbl_InvoiceCostCodes.Type to show records with a type of 'Repairs'

View 2 Replies View Related

Change Recordsource Of Subfrm To Another Saved Query OnOpen

Aug 18, 2006

How do i make my subfrm record source switch to another saved query (qryPendingStatus) when it's opened from the form.

Heres what i am trying to accomplish:
I have a subfrm that i'd like to use to display info in 2 different forms.

There's a form currently for All statuses. Then another new one for Pending status. I'd like to use the same subform for this pending status form also, and in doing that my qryAllStatuses, but change to qryPendingStatus on the subfrm when i open the mainfrom.

This is on the open even ofthe mainform, but does not work (says method not founds...so obviouly i can't use ".Recordsource" here:
Private Sub Form_Open(Cancel As Integer)
Me.subfrmJobInfo.RecordSource = "qryPendingStatus"
End Sub

How can i make this happen?

View 3 Replies View Related

Executing Query

Oct 15, 2007

Hi there,

I am trying to run a query from an ASP page, which also uses other queries. I get the following error message: [Microsoft][ODBC Microsoft Access Driver] You tried to execute a query that does not include the specified expression 'Expr1' as part of an aggregate function, this is in qrySessionsEverything.


The query name is qrySessionsEverything.
It executes the line:

SELECT * FROM qrySessionsEverything

The queries are below:

qrySessionsEverything
SELECT tblSessions.SessionID AS Expr1, tblSessions.CourseID AS Expr2, tblCourses.CourseName AS Expr3, tblSessions.SessionDate AS Expr4, tblSessions.StartTime AS Expr5, tblSessions.EndTime AS Expr6, tblVenues.VenueID AS Expr7, tblVenues.VenueName AS Expr8, tblVenues.Capacity AS Expr9, tblVenues.Capacity-[bytAttendees] AS bytAvailablePlaces, qrySessionsAccepted.bytAttendees AS Expr10, tblVenues.Link AS Expr11, qrySessionsPending.Pending AS Expr12, [TrainerFirstName] & " " & [TrainerSurname] AS strTrainer, tblSessions.TrainerID AS Expr13
FROM tblTrainers, tblCourses, qrySessionsAccepted, qrySessionsPending, tblVenues, tblSessions
GROUP BY tblSessions.SessionID, tblSessions.CourseID, tblCourses.CourseName, tblSessions.SessionDate, tblSessions.StartTime, tblSessions.EndTime, tblVenues.VenueID, tblVenues.VenueName, tblVenues.Capacity, qrySessionsAccepted.bytAttendees, tblVenues.Link, qrySessionsPending.Pending, [TrainerFirstName] & " " & [TrainerSurname], tblSessions.TrainerID;

qrySessionsAccepted
SELECT tblSessions.SessionID AS Expr1, tblSessions.CourseID AS Expr2, tblSessions.SessionDate AS Expr3, tblSessions.StartTime AS Expr4, tblSessions.EndTime AS Expr5, tblSessions.VenueID AS Expr6, tblVenues.VenueName AS Expr7, tblVenues.Capacity AS Expr8, [Capacity]-[bytAttendees] AS bytAvailablePlaces, Count(qryDelegatesAccepted.DelegateID) AS bytAttendees, tblVenues.Link AS Expr9
FROM tblVenues, tblSessions, qryDelegatesAccepted
GROUP BY tblSessions.SessionID, tblSessions.CourseID, tblSessions.SessionDate, tblSessions.StartTime, tblSessions.EndTime, tblSessions.VenueID, tblVenues.VenueName, tblVenues.Capacity, tblVenues.Link
ORDER BY tblSessions.SessionDate, tblSessions.StartTime;

qrySessionsPending
SELECT tblSessions.SessionID AS Expr1, tblSessions.CourseID AS Expr2, tblSessions.SessionDate AS Expr3, tblSessions.StartTime AS Expr4, tblSessions.EndTime AS Expr5, tblSessions.VenueID AS Expr6, tblVenues.VenueName AS Expr7, tblVenues.Capacity AS Expr8, tblVenues.Link AS Expr9, Count(qryDelegatesPending.SessionID) AS bytPending
FROM tblVenues, tblSessions, qryDelegatesPending
GROUP BY tblSessions.SessionID, tblSessions.CourseID, tblSessions.SessionDate, tblSessions.StartTime, tblSessions.EndTime, tblSessions.VenueID, tblVenues.VenueName, tblVenues.Capacity, tblVenues.Link
ORDER BY tblSessions.SessionDate, tblSessions.StartTime;

qryDelegatesAccepted
SELECT tblDelegates.DelID AS Expr1, tblDelegates.SessionID AS Expr2, tblDelegates.DelTitle AS Expr3, tblDelegates.DelFirstName AS Expr4, tblDelegates.DelSurname AS Expr5, tblDelegates.DelHospital AS Expr6, tblDelegates.DelDepartment AS Expr7, tblDelegates.DelPhone AS Expr8, tblDelegates.DelBleeper AS Expr9, tblDelegates.DelEmail AS Expr10, tblDelegates.DateSubmitted AS Expr11, tblDelegates.Accepted AS Expr12, tblDelegates.Rejected AS Expr13
FROM tblDelegates
GROUP BY tblDelegates.DelegateID, tblDelegates.SessionID, tblDelegates.DelTitle, tblDelegates.DelFirstName, tblDelegates.DelSurname, tblDelegates.DelHospitall, tblDelegates.DelDepartment, tblDelegates.DelPhone, tblDelegates.DelBleeper, tblDelegates.DelEmail, tblDelegates.DateSubmitted, tblDelegates.Accepted, tblDelegates.Rejected
HAVING (((tblDelegates.Accepted)=True) And ((tblDelegates.Rejected)<>True));

qryDelegatesPending
SELECT tblDelegates.DelegateID AS Expr1, tblDelegates.SessionID AS Expr2, tblDelegates.DelTitle AS Expr3, tblDelegates.DelFirstName AS Expr4, tblDelegates.DelSurname AS Expr5, tblDelegates.DelHospitall AS Expr6, tblDelegates.DelDepartment AS Expr7, tblDelegates.DelPhone AS Expr8, tblDelegates.DelBleeper AS Expr9, tblDelegates.DelEmail AS Expr10, tblDelegates.DateSubmitted AS Expr11, tblDelegates.Accepted AS Expr12, tblDelegates.Rejected AS Expr13
FROM tblDelegates
GROUP BY tblDelegates.DelegateID, tblDelegates.SessionID, tblDelegates.DelTitle, tblDelegates.DelFirstName, tblDelegates.DelSurname, tblDelegates.DelHospital, tblDelegates.DelDepartment, tblDelegates.DelPhone, tblDelegates.strDelegateBleep, tblDelegates.DelEmail, tblDelegates.DateSubmitted, tblDelegates.Accepted, tblDelegates.Rejected
HAVING (((tblDelegates.Accepted)<>True) And ((tblDelegates.Rejected)<>True));


Please can you help me.

Thanks,
Bash.

View 1 Replies View Related

Executing Query In VBA

Oct 31, 2007

Hi, I am a beginner in access. I am trying to execute the below query through VBA on a click event on a Command Button in a Form. I am taking input parameter from Form, based on which I want the query result( dynamic Query Parameter).
I getting the attached error message

Please help me out in executing this query in VBA. An example would be of great help. Thanks in advance..

View 14 Replies View Related

SQL INSERT -- Asking For Parameters When Executing?!

Jul 22, 2005

Hi all,

I've searched for a solution, and the proposed solution didn't work for me.

I am executing an SQL statement to insert values into a History table when deleting a value in a subform. Two of the 5 values are asking me for parameters when the SQL executes and I cant figure out why! The datatypes they are inserting into are correct and I'm at a loss. The 2 values giving me grief are Manufacturer and Model.

Here's the code:

Dim sSQLMachHistory As String

MsgBox "me.acctid: " & Me.AccountID
MsgBox "me.manufac: " & Me.Manufacturer & " me.serial: " & Me.SerialNumber
MsgBox "model: " & Me.Model

'Insert into History Table:
sSQLMachHistory = "INSERT INTO tblMachineHistory (SerialNumber, Manufacturer, Model, AccountID, MachineID) VALUES (" & Me.SerialNumber & ", " & Me.Manufacturer & ", " & Me.Model & ", " & Me.AccountID & ", " & Me.MachineID & ")"

MsgBox sSQLMachHistory

DoCmd.SetWarnings False
DoCmd.RunSQL sSQLMachHistory
DoCmd.SetWarnings True

My message boxes show me all the values are displaying and should be inserting into the table -- any ideas??? :confused:

cheers

Mike

View 2 Replies View Related

Executing Code On Database Open?

Apr 10, 2007

hi,

I was wandering if it is possible to implicitly execute code upon the opening of a database? If so how do I do this? I have code to convert the page settings of a report from a command click but wanted this to be done automatically...

cheers

tania

View 6 Replies View Related

BeforeUpdate Event Executing Too Many Times

Oct 16, 2005

I have a mainform with a search function so the user can select a record to view and update. The selected record is displayed in Subform1 on Page1 of a tab control. The record source of this form is Query1. Page2 of the tab control contains Subform2; record source is the result of Query1 joined to Query2.

The forms correctly displays, updates and adds records my problem occurs when I add VBA code to the BeforeUpdate event of a control on Subform1. The code appears to execute once for each page in the tab control.

Has anyone any suggestions on how I can correct my problem.

Thanks

Fearless

View 3 Replies View Related

Having Trouble In Executing TreeCtrl Code

Jul 11, 2006

Hi,

I am having trouble in implementing the TreeCtrl structure. I have a simple database for testing purpose and I am not able to make it work. There appears to be a problem with the bookmark property and I get an error message:
"can't Add child:Arguments are of wrong Type, are out of acceptable range, or are in conflict with one another".

I have attached the database here and could you please see what is wrong with my code.


Thanks
Priya

View 5 Replies View Related

Executing Command Buttons On Other Forms

Sep 20, 2004

Hi

I have a Visible form and an Invisible (visible=false) form open at the same time. Is it possible to use a button on the visible form to execute the code behind a button in the invisible form. The subroutine on the invisible form is Public. I tried DoCmd.RunCommand and a macro with RunCode but... nada...

(There is a valid reason for this approach but i will spare you the boring explanation. I can think of a work around where I can bypass this need, but this way is cleaner (there are cases where the invisible form is visible and used directly, the form has data which is sent to a report to create a label). I have done everything else with VBA code but for some reason can't get this to work, so now i am obsessed)

Thanks, this forum is really a gem!

View 2 Replies View Related

Executing An Update Command With “'” In The String

Nov 3, 2006

Hi,
I try to execute an update command i.e.:
UPDATE Results set Data = 'Heiner's key' where ValidationNumber = 1 and TestNumber = 2 and Line = 'E1'.
Access does not let me do this because the “'” in Heiner's terminates the update string prematurely.
Does anyone have a suggestion how to do this? Thank you.

View 4 Replies View Related

Create Custom Box Before Executing Query

Jan 9, 2012

I am looking to check, whether i would be able to "add an Message box with a "Message : "Executes all queries all is well.mdb before executing this query ?" , if yes, continue executing the query, else, Exit out of the database?

View 1 Replies View Related

Executing A Query On Periodic Basis At Midnight At 00:05

Oct 31, 2005

I am trying to execute query every midnight at 00:05 and append data into a table. This query reads the data from a linked table and appends the records into the local table.

Access doesn't triggers so I have no clue which way to proceed.

Can anybody help me creating a logic to execute query at midnight?

Regards
Giri

View 2 Replies View Related

Executing A Query On Highlighted Record In Listbox

Jul 25, 2005

How do i apply a query that i want to execute only on a highlighted record in a listbox.

If there is a link, sample database or lines of code could you please assist.

Currently everything is being executed on all of the records in the query.


Also Does Access 2000 support codes for drag and drop forms?

View 2 Replies View Related

Executing A Subforms Procedures From The Parent Form

Dec 19, 2005

is there a way i can call a sub forms procedure from the main parent form.

in other words i have a button command i want to execute

View 2 Replies View Related

Storing A Calculation As A String In A Table And Executing It In A Query.

Jun 11, 2007

N.B. This is not your usual 'Bad practice to Store calculated values in a table' post

I have a table of items.
Each item has a different formula attached which I need to store as a literal value in the table and execute it as a normal expression in a query or vb.

e.g

Columns:Item, QTY, Hrs, mins, ItemFormula
Data: Car, 2, 7, 3, [QTY]+ [Hrs]/[mins]

So ' [QTY]+ [Hrs]/[mins]' would literally be stored for that rercod and is how it would be displayed in a table, form, report etc as it is important for the user to see how the calculation is performed as well as seeing the end result which will be calculated as normal in vb or a query.
The formula will vary from record to record.

How do I go about this?

TIA

View 6 Replies View Related

Modules & VBA :: Why On Error Is Skipping Next Error In Sequence

Sep 1, 2014

Code:

Private Sub Consolidate_Click()
Dim temp As Variant
Excel.Application.Visible = True
temp = Dir(CurrentProject.Path & "Inputs")
Do While temp <> vbNullString

[Code] ....

From the second iteration its not picking the error.

View 5 Replies View Related

Modules & VBA :: Programmatically Alter Detail Of Report Then Use That Report As Subreport

Jun 26, 2013

I have a report which programmatically sets the value of some labels based on its own internal logic for each line of the detail section of a report. This all works fine and dandy, using the Detail_format event, and accessing detail.controls.item(x).caption.

HOWEVER, when I then embed the report as a subreport (which I need to do), I goes wrong. Here, I get the values of the last row of the detail repeated in every previous one. I'm suspecting because the parent report has its own 'detail' (I've tried giving the subreport its own distinct detail name).

View 1 Replies View Related

Modules & VBA :: How To Print Report Without Displaying Report

Jul 8, 2015

On this form, there is a text box for Quantity...At the end of the form, there will be a button that when pressed:The current record the data on the form is entered for is saved,A report is printed on a specific printer,I do not want the report to actual display,The number of copies it prints should be equal to what the quantity field indicates.I do have the report already created and the Quantity field is on the report (just not visible).Once this all happens, it should return the user to the form, that is blank, waiting for a new record entry.

View 1 Replies View Related

#Error? Within Report

Nov 8, 2006

Hi Guys, I have 2 machines both running MS Access 2003 with Office SP2 installed. From one machine i can access a report and print off fine. However from the second machine i receive a #Error? in certain fields of the report. Maybe someone could help me as to why this is!?

Thanks

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved