Run Time error 438 - Object doesnt support this property or method (1 Viewer)

Glowackattack

Registered User.
Local time
Today, 05:59
Joined
Feb 26, 2008
Messages
126
Hi,
I am having problems with an access database i created a couple months ago, and i should probably start by saying i recently got a new computer and this is my first time using the database since(i am running access 03 on the new one too). Here is a breif overview of my setup, I have a form, and within it is a subform, and within the subform is another subform, i guess an easy way to describe is like this we have a case(main form info), which breaks down into policies(first subform), which breaks down into payment information for each policy (2nd subform). I have fields on the first subform that sums payment information for each policy, when i update information on the 2nd subform, i have the following code.

Code:
Private Sub Premium_Amount_AfterUpdate()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim record As Integer
Dim ParentRecord As Integer


record = Me.CurrentRecord
ParentRecord = Me.Parent.CurrentRecord

Forms![Frm_CaseOverview]![Frm_PolicyOverview_subform].Form.Requery
Forms![Frm_CaseOverview]![Frm_PolicyOverview_subform].SetFocus

DoCmd.GoToRecord , , acGoTo, (ParentRecord)

[Frm_PolicyBreakdown_subform].Form.Requery
Forms![Frm_CaseOverview]![Frm_PolicyOverview_subform]![Frm_PolicyBreakdown_subform].SetFocus

DoCmd.GoToRecord , , acGoTo, (record + 1)

[Type of Premium].SetFocus

Everything worked fine in the past, and the field i wanted (type of premium) had focus after the update, now when i run this i get the error, if i comment out the last line, the premium amount field of the next record gets focus, not the "Type of Premium" field which i want....but at least i dont get an error and everything else updates like i want, i just want the Type of premium field to have focus for ease of data entry.

Please let me know if i can explain this better, and thanks for your help in advance.
 

nIGHTmAYOR

Registered User.
Local time
Today, 04:59
Joined
Sep 2, 2008
Messages
240
ok since u say all the above code r valied however ur true problem lays in [Type of Premium].SetFocus then i guess i should neglect it and move on to your main problem.
You say [Type of Premium].SetFocus produce "Run Time error 438 - Object doesnt support this property or method" now did you try and add the exact path to your control ?
Your current code assumes that :
Forms![Frm_CaseOverview]![Frm_PolicyOverview_subform]![Frm_PolicyBreakdown_subform]![Type of Premium].SetFocus is a valied and present control , so is it ?
if not please type in the exact path to your control , if i was access i would get confused too :)
 

Glowackattack

Registered User.
Local time
Today, 05:59
Joined
Feb 26, 2008
Messages
126
That is exactly what i thought at first, and yes i did try that, but i reverted it back to the original code posted above since it did work at some point in time.

When i just looked at the properties of the control, and this picture is what it says, i noticed the name is "Combo15" even though the control source is "Type of Premium"...havent tried this in the code yet, maybe this is the problem???

Oh, and thanks for your input Nightmayor, it is appreciated :)
 

Attachments

  • untitled.JPG
    untitled.JPG
    71.9 KB · Views: 928

Glowackattack

Registered User.
Local time
Today, 05:59
Joined
Feb 26, 2008
Messages
126
That is the problem...and with the answer comes the realization on how i broke it.

I took the field "Type of Premium" off the form and replaced it with a combo box that fed into the Type of premium field on the table...i just needed to revert my code to reflect the new combo box not the old field i had deleted.

Thanks for your input again nightmayor...
 

nIGHTmAYOR

Registered User.
Local time
Today, 04:59
Joined
Sep 2, 2008
Messages
240
heh
just copy and paste "Type of Premium" to Name field please :)
 

Glowackattack

Registered User.
Local time
Today, 05:59
Joined
Feb 26, 2008
Messages
126
heh
just copy and paste "Type of Premium" to Name field please :)

Just want to add a sentance for reference in case anyone else uses this...While typing "Type of Premium" into the name field would work if there wasnt already a field named that, so i just named it "Combo_Type_of_Premium" so it doesnt conflict with the field that the combo box feeds on the table.

Thanks again.
 

nIGHTmAYOR

Registered User.
Local time
Today, 04:59
Joined
Sep 2, 2008
Messages
240
it realy wouldnt matter if field names and control names collide :) however yes spaces are not recommended in nameings meanwhile i have seen bizillion users posting sources utilizing it (spaced names) to the extreme so i'm becoming to think of it as a norm :)
 

Glowackattack

Registered User.
Local time
Today, 05:59
Joined
Feb 26, 2008
Messages
126
it realy wouldnt matter if field names and control names collide

You learn something new everyday :) i got an error when i tried to name them the same so i figured i'd rather be safe than sorry...i'm still pretty new to access in general, i know just enough to mess it up really bad :D
 

nIGHTmAYOR

Registered User.
Local time
Today, 04:59
Joined
Sep 2, 2008
Messages
240
the error was probably a result of another issue (repetitions , invalid charachters , blas blas) but realy its not a problem to keep both the same name , i use it all the time and it saves me the hassel of haveing to track multiple names for the same field.
 

Users who are viewing this thread

Top Bottom