VBA Enounted A Problem While Attempting To Access A Property Or Method...blah Blah...

Jun 1, 2007

My db works well, it has been compressed/repaired & the code complied without any problems until I convert it to an Mde :confused:

The problem I have is that for some reason three of my sub forms will not function properly without getting this on click warning

The expression on Click you entered as the event property setting produced the following error:The expression you entered refers to an object that is closed or doesn't exist.

Visual Basic for Applications (VBA) encountered a problem while attempting to access a property or method. The problem may be one of the following:
A reference is missing.
For help restoring missing references, see the Microsoft Knowledge Base article 283806.
An Expression is misspelled.
Check all expressions used in event properties for correct spelling.
A user-defined function is declared as a sub or as a private function in a module.
Expressions can resolve a user-defined function only if the function is declared as one of the following:
- A public function in a module
- A public or private function in a code module of the current form or report
Security in Access is set to Medium or High and the Microsoft Jet 4.0 SP8 update is not installed.
A more recent verion of Jet 4.0 must be installed for Access to function properly when security is set to Medium or High. To obtain the latest version of Microsoft Jet, go to Windows Update.

I don't understand why there is a problem if it works fine without converting it to a Mde.

The 3 subforms do have one thing in common though

they have a cmd button that moves the focus to another object on the form & then the subforms visibility is set to false.

[Private Sub CmdClose_Click()

On Error GoTo 0 'Err_cmdClose_Click
If DCount("*", "tblTaskScheduleRates", "[SRLINKTask] = " & Me.Parent.TaskID) = 0 Then
Me.Parent.frmFlashRates.Visible = True
Me.Parent.cmdViewRates.Visible = True

End If

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Parent.cmdSaveRecord.SetFocus
Me.Parent.frmTaskScheduleRatesSubForm.Visible = False
Me.Parent.frmTaskScheduleRatesViewSubForm!lstAssig ned.Requery
Me.Parent!lstRevisedCost.Visible = True


Exit_cmdClose_Click:
Exit Sub

Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click


End Sub

Private Sub CmdClose_Click()
Me.Parent.cmdAssignTask.SetFocus
Me.Parent.frmTimeRecordAssignSubForm.Visible = False
Me.Parent.frmTaskMessageViewSubForm!lstMessages.Re query
Me.Parent!frmSumTimeRecordsSubForm!lstAssigned.Req uery
Me.Parent!lstRevisedCost.Visible = True

If DCount("*", "qrySubbyFlash", "[TaskID] = " & Me.Parent!TaskID) > 0 Then
Me.Parent!cboTaskStatus = Me.Parent!cboTaskStatus.ItemData(1)
Else
Me.Parent!cboTaskStatus = Me.Parent!cboTaskStatus.ItemData(0)
End If

If DCount("*", "qryOperativeFlash", "[TTLINKTask] = " & Me.Parent!TaskID) > 0 Then
Me.Parent!cboTaskStatus = Me.Parent!cboTaskStatus.ItemData(1)
End If


End Sub

Private Sub cmdSave_Click()

If DCount("*", "tblTaskMessage", "[TMLINKTask] = " & Me.Parent.TaskID) = 0 Then
Me.Parent.frmFlashMessage.Visible = True
Me.Parent.cmdViewMessages.Visible = True
End If
Me.Parent.cmdNotes.SetFocus
Me.Parent.frmTaskMessageSubForm.Visible = False
Me.Parent.frmTaskMessageViewSubForm!lstMessages.Re query
Me.Parent!lstRevisedCost.Visible = True

End Sub


it works just fine as a normal database but for some reason it causes problems as an Mde.

any ideas?

thanks

View Replies


ADVERTISEMENT

WHERE *='blah' ----- How Would You Make This Work?

Mar 22, 2006

Hi Guys,

I basically want an SQL statement that will search all fields of a table for a certain value. At first I thought that tihs might work..
Code:SELECT * FROM tblExample WHERE *='blah';

But it doesnt :-/

So, is there any other method of doing this? I know that I could just include each individual field name, but Im lazy - and its a big table (plus I want to use a similar query on a few other tables, so I want it to be fairly generic).

View 1 Replies View Related

Runtime Error 7768 In Order To Change..blah

Mar 30, 2006

ok. here's the deal

Private Sub cmdsave_Click()
On Error GoTo err_handler

Dim lnglaptime As Long

lnglaptime = Me.txtLapNumber.Value

Me.Dirty = True
Me.lstAll.Requery

Me.lstAll.Value = lnglaptime

exitpoint:
Exit Sub
err_handler:
MsgBox Err.Description, , "Error in cmdSave"
Resume exitpoint
Resume
End Sub

I don't no whats happening, the error is apprently in the "me.dirty = true" but i dont know. Help?

View 1 Replies View Related

Object Does Not Support This Property Or Method.

Apr 13, 2007

Hi,

I want to disable a button right after click it. Because I could not disable a control that has got the focus, i tried to shift the focus to another control; however, all controls that I tried to shift the focus to don't support the method (SetFocus = true).

I want to do this on a subform's control, but I keep getting this error:
Object does not support this property or method.

Any susggestions will be very much appreciated.

B:)

View 3 Replies View Related

Object Doesn't Support This Property Or Method

Feb 27, 2006

Using the following function to update records and receive this error: "Object doesn't support this property or method"

Code:Public Function edit_users()On Error GoTo user_errorDim StrSQL As String, strUser As String, uid As String, section As String, chkAdmin As IntegerDim fname As String, lname As Stringuid = Forms![ctrlpanel]![subEditUsers].Form!cmbUseridsection = Forms![ctrlpanel]![subEditUsers].Form!cmbSectionfname = Forms![ctrlpanel]![subEditUsers].Form!txtFnamelname = Forms![ctrlpanel]![subEditUsers].Form!txtLnamechkAdmin = Forms![ctrlpanel]![subEditUsers].Forms!chkAdminIf uid = "" Or section = "" Or fname = "" Or lname = "" ThenMsgBox "You have left one or more fields blank.", vbOKOnly, "Edit User Error"GoTo user_exitEnd IfStrSQL = "UPDATE users SET [section] = '" & section & "', [fname] = '" & fname & "', [lname] = '" & lname & "', admin = '" & chkAdmin & "' WHERE [userid] = '" & uid & "'"Call get_rs(StrSQL)user_exit:Exit Functionuser_error: MsgBox Err.DescriptionGoTo user_exit:End Function

Here is the connection get_rs:

Code:Public Function get_rs(StrSQL)Dim temp_rs As New ADODB.RecordsetSet temp_rs = New ADODB.Recordsettemp_rs.LockType = adLockOptimisticWith temp_rs .ActiveConnection = open_conn() .Open (StrSQL)End WithSet get_rs = temp_rsSet temp_rs = NothingEnd Function

Thanks

View 3 Replies View Related

Modules & VBA :: Attempting To Import Tab Delimited Text File With 274 Columns Into 2 Access Tables

Aug 2, 2013

I'm trying to import a text file with 273 fields into two tables. I've been able to do this with the code I found on an old thread and I'm now trying to accomplish everything with one step. The file I'm importing is tab delimited text file. With this current code I'm only able to populate the first record in the table and then I get error message. (Run-time error '3265') (Item cannot be found in the collection corresponding to the reqested name or ordinal).

Code:

Public Sub ImportTextFile()
' to use the ADODB.Recordset, be sure you have a reference set to ADO
Dim rst As ADODb.Recordset
Dim rst2 As ADODb.Recordset
Dim strFile As String
Dim strInput As String
Dim varSplit As Variant
Dim intCount As Integer

[code]...

View 4 Replies View Related

Modules & VBA :: Outlook Restrict Method From Access

Mar 13, 2015

I have the below script:

For Each Item In offexchfldr.Items.Restrict("[SenderName] = '" & frmfm & "'") ' Select Items that match Sender Name on form
If Item.TaskSubject = subid Then
Item.Categories = frmcat ' Update category from form to outlook
Item.Save
End If
Next

This script checks every item in the outlook inbox where the item.SenderName = my database sendername

This works every time except for when the sendername has quotes or single quotes in their name. So i am trying to utlize the replace method on the item sendername before trying to find the items in the inbox but its not working.

Below is my attempt that does not work.

For Each Item In offexchfldr.Items.Restrict("Replace([SenderName],',"") = '" & frmfm & "'") ' Select Items that match Sender Name on form

View 2 Replies View Related

Is There Any Method To Synchronize Two Access File Which In Desktop And Network Drive

Aug 14, 2007

Here are some background . My company got a access file in a network drive.The data entry simply open the file in the network drive.But once the data has increased (~400mb) sudddendly,all process slow down. Like search , using report etc.Is there any method to imporive the situation?Some guys suggest me to copy the data file to the desktop and sync them.Can it it work?IF works,how to do that?

thanks gratefully for any ans

View 3 Replies View Related

Database Closes While Attempting To Open A Report

Feb 28, 2008

I have a database that has been functioning very well for nearly a year. Suddenly today, as I attempt to open a report (very complex report takes about 2 minutes to render), the database closes before displaying the report. I have moved the db from the server to my desktop and the same problem happens. It does not matter if I try to execute the report from the switchboard or from the Report Object List.

DB is 344,940KB. I have larger db's that work fine.

I don't know where to look for a way to stop this from happening. Nothing was done to the form design between the last time it worked properly, and today.

Any thoughts are welcome.

Thanks,

George

View 4 Replies View Related

Attempting To Change Data Type For Field But Can't Because....

Dec 20, 2006

I'm a bit of a newbie, so lets just get that out of the way....

I have a field in a table that was originally a text data type. I want to change it to a "lookup" data type using the lookup wizard. However, Access doesn't allow me to do this and prompts me with "You can't change the data type....its part of one or more relationships...". But there are no relationships? There may have been previously, but I've deleted them all from Relationships window.

This has happened several times now. I am in the process of designing the database and have been changing my mind about data types when I realize that I can use a lookup data type. The only fix I have found is to make a copy of the table in question and then change the data type of the problem field. Unfortunately this screws up my forms...which is a pain.

Why would Access say that there are relationships in the relationships window when in fact there are none?

I've attach a copy of my db. The field in question is located in the "Activities" table. The field name is "ACTIVITY_NAME". I am trying to use a lookup from the activityNames table using the "ActivityName" column.

Thanks for any help in this matter.

View 2 Replies View Related

Modules & VBA :: Attempting To Clean Up A Free Form Text Box

Jan 14, 2014

When we are managing incidents, users have decided on their own method of recording the incident... here are some examples

INC002546
INCIDENT002546
2546
INC# 2546
Inc# 2546
inc# 2546
Inc # 2546

The correct way is the following:
Inc# 2546
^ capital I, no space between "c" and "#" but a space AFTER the "#"

Then the 4 digit long number.I was thinking along the lines of trying to identify the number, removing everything else and then placing "Inc# " before it...
currently we allow notes, which should be made like such: Inc# 2546 - Notes.however, people have their own method for this too (however most of them are at least after then incident number so that makes things much easier)another issue is on the same database, some manual requests also appear which have different entry format: RQ# GK034LW2052 but that contains a mixture of letters and numbers... so when identifying the request number... as long as I make sure that it is a number and not a string of numbers and letters, I should be ok..

View 8 Replies View Related

Access Query Property From Form?

Jun 9, 2005

I have a form that is to be used to browse through parts using various filters (like category, snippets of part number or description) to find particular components, and then draw information from those components onto the form to be used for other things.

Queries I seem to understand - I've made a query which I've embedded on the form which happily filters the parts using the combo-boxes and text boxes on the form.

What I can't figure out is how to access the information IN the query! There doesn't seem to be a "double-click" event, or a "highlighted row" property, that I can use to tell the query WHICH of the parts returned after filtering is the particular one Im interested in, to draw information from the row.

What I want is a command button that, once the desired part is selected, "sucks" the data out of the query into text boxes on the form.

I've tried something like -


Private Sub cmdSelect_Click()

Me.txtSelectedPartID = Me.qryPartFinder.PartID

End Sub

...but it tells me that the method or data member is not found. When I'm typing the code the auto-complete thingy happily finds "qryPartFinder" when I type "me", but none of the available properties in the list for qryPartFinder seem to be what I need.

How DO you access the data in a highlighted (and/or somehow selected) row?

TIA.

Col.

View 2 Replies View Related

Attempting To Make Tech Support Data Base And Have A Few Questions

Jul 12, 2005

I am a newbie here so i dont know all the cool names and phrases for everything so be gentle with me :).

My boss wants me to make it so the address of a company automatically pops up in the database, so if they call multiple times, the user doesnt have to keep putting the address in. If the company hasnt called before, the user would have to fill out a company form that pops up if the companys name isnt already in the database. Any info on how to do this would be EXTREMELY helpful.

I also need to know how to make access send you an email if certain information hasn't been finalized after a certain period of time.

Thanks for your help guys. Ive been stuck on these problems for A WHILE to say the least...

View 8 Replies View Related

Access 2007 Property Sheet Disappear

Oct 2, 2007

Hi,

My property sheet has disappeared I don't know what I did. How can I make it reappears? I have try by pressing the SHFIT key but it won't work. Also, I have created a new database and open it, the property sheet isn't appeared. The icon are still there but when I press on it, it does not response.


Thanks,

Le

View 10 Replies View Related

General :: Access Object Property Description

Dec 14, 2012

I'm working on a query that lists all the queries in an Access database, and I would like the query to show the object description which is displayed when you right-click an object and display the object's properties. For queries, this is a text box just below the query name in the properties window.

So far, all I have is:

Code:
SELECT ID, Name FROM mSysObjects;

I would like to have something like:

Code:
SELECT ID, Name, Description FROM mSysObjects;

View 3 Replies View Related

Access Form Text Box Name Property With A Bracket

Oct 3, 2014

Is there any way to name the text box like "Contract (1)" I can write it this way but it is recognized as Me.Contract_1_.

I need to name it Contract(1) as I have to run some iteration in VBA.

View 4 Replies View Related

Queries :: Database Engine Error When Attempting To Use A Form Control In A Query

May 5, 2015

I have included the form control [Forms]![AddMatterFrm]![MatterIdFld] in the criteria of the first of three queries.

1st Query - with the form control isolates transactions relative to the contents of the form variable (coming from an open Form)

The second query is a XTAB query further processing and summarising the transaction.

The 3rd one adds another expression field.

I execute the 3rd Query using the command below

Set rstDebtTrans3Qry = db.OpenRecordset("DebtTrans3Qry")

I then get the ....Database Engine does not recognise [Forms]![AddMatterFrm]![MatterIdFld] as a valid field name or expression.

If I take the control reference out and hard wire the value I want - there is no problem.

I'm sure it has something to do with the XTAB query but I need a solution.

View 9 Replies View Related

Forms :: Attempting To Have Single Query Result Display In Text Box On Form

Jul 3, 2014

I have the need to display the return of my "Sum Query" to display in a text box.

I need the attached below value (40500) in the "SumofQuery" attachment, which updates every 5 minutes to display on the "StatusBoard" attachment text box.

I have been searching for a good 10 hours on how to do this and still cannot find it.

View 14 Replies View Related

Forms :: Make Certain User Enter Records On Subform Before Attempting To Save Main Form

Dec 4, 2014

How can I make certain my user enters records on a subform before attempting to save the main form? Right now they can completely ignore the subform before saving the record.The Main form has business address, etc. on it. the subform is bound to a join table that lists the multiple categories, subcategories and sector the business is listed in for a directory.

I already have my fields set to required at the table level in the join table, and have some existing VBA in both my subform (to update edited date) and my form (to validate empty records where a certain condition is met) but that's not the issue...

How do I focus the user to enter a record on the subform to the point where they are forced to enter something and complete the subform before the record is updated.

View 2 Replies View Related

Forms :: Use Formula In Caption Property For Page In Tab Control (Access 2007)

Oct 7, 2013

Is it possible to use a formula in the Caption property of a page in a tab control (i.e. to make it dynamic)

I have a number of tabs each with their own subform (with each subform driven by its own unique query)

I'd like the tab name to include the number of records returned by that query (so as records are added, the tab name is automatically updated with the new number)

So something along the lines of :

Page 1 (" & DCount("[ID]","[qryQuery1]") & ")"

Such that the page name appears as :

Page 1 (7)

I know I can code this programmatically but then that code has to be triggered by some event and I need the counts to be as real-time as feasibly possible rather than requiring the user to click on a control to trigger it. I was hoping by using a formula directly in the Caption property of the page, it would be dynamically updated every time a new record was added without the need to trigger an event first.

View 2 Replies View Related

Forms :: Access 2003 VBA / Unable To Tick Labels Property Of Axis Class

Dec 3, 2013

I have the following code:

Dim FrmGraphObj As Object
Set FrmGraphObj = Forms![frmE Weekly Efficiency]![gph_WeeklyEfficiency].Object.Application.Chart
FrmGraphObj.Axes(xlValue).TickLabels.NumberFormat = "0%"

I continually receive a runtime error 1004 " unable to get tick labels property of the axis class"

if I remove this code, then I error on the following code:

Dim FrmGraphObj As Object
Set FrmGraphObj = Forms![frmE Weekly Efficiency]![gph_WeeklyEfficiency].Object.Application.Chart
If FrmGraphObj.SeriesCollection(2).HasDataLabels Then

also a runtime 1004: "unable to get the seriescollection property of the chart class" on the last line above

searched this forum and found:

If your chart is in a form (or report), you have to:

1) refer to the form (or report) name (Form_Charts)

2) refer to the name of the object frame holding your chart (.Graph1)

3) refer to the object within the frame (.Object)

4) refer to the application that created the object (.Application)

5) refer to the actual chart itself (.Chart)

6) refer to the axes collection and select the axis you want to reference - in this case the category, or X-axis (.Axes(xlCategory))

I made the assumption, that I would just replace xlCategory with xlValue for the Y-axis. So I'm back to:

Set FrmGraphObj = Forms![frmE Weekly Efficiency]![gph_WeeklyEfficiency].Object.Application.Graph
With FrmGraphObj.Axes(xlValue)
.TickLabels.NumberFormat = "0%"
End With

Same error....

Looked in the Microsoft Graph Visual Basic Reference and it indicated:

"Tick-mark label text for the value axis is calculated based on the MajorUnit, MinimumScale, and MaximumScale properties of the value axis. To change the tick-mark label text for the value axis, you must change the values of these properties."

I reset my code to call these 2 functions prior to changing the number format.....

Public Sub txtMaxPercent_AfterUpdate()
Dim FrmGraphObj As Object
Set FrmGraphObj = Forms![frmE Weekly Efficiency]![gph_WeeklyEfficiency].Object.Application.Chart
FrmGraphObj.Axes(xlValue).MaximumScale = txtMaxPercent
End Sub
Public Sub txtMinPercent_AfterUpdate()
Dim FrmGraphObj As Object
Set FrmGraphObj = Forms![frmE Weekly Efficiency]![gph_WeeklyEfficiency].Object.Application.Chart
FrmGraphObj.Axes(xlValue).MinimumScale = txtMinPercent
End Sub

now I am receiving error 1004 again, this time it states "Unable to set the minimumscale property of the axis class" erroring on this line....

FrmGraphObj.Axes(xlValue).MinimumScale = txtMinPercent
debug.Print me.txtMinPercent
0.51

View 2 Replies View Related

Is This The Best Method?

Jan 8, 2008

Hi,

I have a form which has a subform. For each record, I have to assign a user, which comes from a user table. Due to the large number of users I have created a user selection form, which is designed as a popup. This form has an option group to select department, which then filters a combo box for selection of a user. On clicking a user, the window closes and that username is inserted into the form.

Since this particular user form will be used in multiple locations, I was thinking of having a global variable, which is set when a field is clicked. i.e. a variable called nameSelect. When a user is being assigned in form A, the user field is clicked, nameSelect = 3.

I was then thinking of having within the user selection form coding a Select Case function which depending on the value of nameSelect assigned the selected user to the correct location.

Is this the best method to tackle this?

View 2 Replies View Related

Using The FindFirst Method With DAO

Aug 1, 2005

I am writing an event procedure to check to see if a particular Project number exist in a recordset. I am trying to use the findfirst method and are having some problems. Here is my code.

Private Sub Command3_Click()

Dim db As DAO.Database
Dim rs As DAO.Recordset, ProjectNo As String, SqlStr As String, StrProjectNo As String


Set db = CurrentDb()
Set rs = db.OpenRecordset("tblTrackingSheetFrm", dbOpenTable)
StrProjectNo = Me![ProjectNumber]
rs.FindFirst StrProjectNo

If rs.NoMatch Then
Forms![frmProjectCriteria].Visible = False
DoCmd.SetWarnings WarningsOff
DoCmd.OpenQuery "(1)qryDeletetblTrackingSheetFrm"
DoCmd.OpenQuery "(1A)qryDeletetblTrackingSheetTMP"
DoCmd.OpenQuery "(2)qryAppendProjectTasks"
DoCmd.OpenQuery "(3)qryMaketblLaborActuals"
DoCmd.OpenQuery "(3A)qryUpdatetblTrackingSheetTMP"
DoCmd.OpenQuery "(4)qryDeletetblMaterialActualsTMP"
DoCmd.OpenQuery "(5)qryAppendEquipment"
DoCmd.OpenQuery "(6)qryAppendInventory"
DoCmd.OpenQuery "(7)qryAppendPayables"
DoCmd.OpenQuery "(8)qryAppendPurchaseOrder"
DoCmd.OpenQuery "(9)qryUpdateMaterialActuals"
DoCmd.OpenQuery "(A)qryAppendtblTrackingSheetFrm"

DoCmd.SetWarnings WarningsOn
DoCmd.OpenForm "frmTrackingSheet", acNormal

Else

MsgBox " Project worksheet already opened by another user."

rs.Close
End If
End Sub

What this does is check to see if another user has a project open and if so doesnt allow that user to access that project. I am getting the following error when I execute the procedure on the findfirst Code line.

Runtime error 3251 Operation is not supported by this object type.
Can someone take a look and see what I am doing wrong.
Any help is greatly appreciated.

View 2 Replies View Related

Best Deliverable Method

Jan 3, 2006

Hi

I just want to ask what is the best method to deliver an application to the user. The reason of asking is that it needs user to have access software installed which is not cheap Any other method that can help, some sort of exe file that can run without access software or atleast something free...

R

View 1 Replies View Related

FindRecord Method

Apr 24, 2007

When trying to use FindRecord I get a "Runtime error 2406 - the command or action 'FindRecord" isn't available now". The script up to that point is as follows:

Sub Test()

Dim Connection As New ADODB.Connection
Dim Catalog As New ADOX.Catalog
Dim rstRain As New ADODB.Recordset
Dim ppn_0900 As Field

Set Connection = CurrentProject.Connection
Call rstRain.Open("0800Rain", Connection, adOpenForwardOnly)

DoCmd.FindRecord "10", , False, acDown, , acAll


Can anyone point me in the right direction?

View 2 Replies View Related

Best Method Of Storing This Data?

Jun 7, 2005

Hi everyone,

I've recently begun building a database to keep track of stock at work. Nothing particularly special or difficult. I have a little bit of prior experience with Access and VB, but not heaps.

Basically, I've created a tables for parts, companies etc, and am relating all the data together.

At the moment I've made a form that allows you to enter a new part, with Part Number, Description, Category, Supplier, etc.

The complication comes when I want to create an ASSEMBLY of parts. I'd like to create an assembly (which has a lot of similarities to a part, in that it has a part number, description etc), and that assembly needs to store a list of parts that it includes. A simple assembly might include a few items, ie, a bowl of meatballs includes the bowl, a fork, the spaghetti, and 5 meatballs. A more complex assembly (a complete dinner for 5) might include 5 bowls of meatballs (a sub assembly), pepper and salt, 5 glasses and two bottles of coke.

I'm not sure how to best store this assembly data...

I can't really have a table with a finite number of "part" spots because the assemblies get quite large. I'd rather not use an ugly VB macro that stores the PartID's with quantities either, as that could get thoroughly out of hand pretty quickly.

I'm sure there must be a simple method for doing this, but without having a clue as to what it might be called I can't really look for it in help!

Any clues you guys could give me would be great.

Thanks

Col.

View 1 Replies View Related







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