calling objects method

Hello,
I have a collection of objects. Each object has few properties and few 
methods, among which: save, delete, recall and others.
The "save" method of each object runs few private class functions to double 
check data and if everything is fine it adds the data collected in few tables.
I would need a way to iterate the objects in the Collection (and I know how 
to do this) and call for each of them the "save" method. Is this possible? 
Hoping first it is clear...

Thanks,
Rocco
0
Utf
4/5/2010 1:11:01 PM
access.modulesdaovba 1670 articles. 0 followers. Follow

4 Replies
585 Views

Similar Articles

[PageSpeed] 24

it should be:
myCollectionName.Item(itemIndex).Save

....I guess...

"rocco" wrote:

> Hello,
> I have a collection of objects. Each object has few properties and few 
> methods, among which: save, delete, recall and others.
> The "save" method of each object runs few private class functions to double 
> check data and if everything is fine it adds the data collected in few tables.
> I would need a way to iterate the objects in the Collection (and I know how 
> to do this) and call for each of them the "save" method. Is this possible? 
> Hoping first it is clear...
> 
> Thanks,
> Rocco
0
Utf
4/5/2010 1:18:01 PM
Hi,
yes, it should work, something like this:

dim o as object
for each o in MyCollection
    o.Save
next o

-- 
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com


"rocco" <rocco@discussions.microsoft.com> wrote in message 
news:F5A7DCF9-825E-4EF1-9B27-741B64A64F78@microsoft.com...
> Hello,
> I have a collection of objects. Each object has few properties and few
> methods, among which: save, delete, recall and others.
> The "save" method of each object runs few private class functions to 
> double
> check data and if everything is fine it adds the data collected in few 
> tables.
> I would need a way to iterate the objects in the Collection (and I know 
> how
> to do this) and call for each of them the "save" method. Is this possible?
> Hoping first it is clear...
>
> Thanks,
> Rocco 

0
Alex
4/5/2010 2:06:41 PM
"rocco" <rocco@discussions.microsoft.com> wrote in message 
news:531AC139-8865-4705-95A9-F3B9D7C67F9C@microsoft.com...
> it should be:
> myCollectionName.Item(itemIndex).Save
>
> ...I guess...
>
> "rocco" wrote:
>
>> Hello,
>> I have a collection of objects. Each object has few properties and few
>> methods, among which: save, delete, recall and others.
>> The "save" method of each object runs few private class functions to 
>> double
>> check data and if everything is fine it adds the data collected in few 
>> tables.
>> I would need a way to iterate the objects in the Collection (and I know 
>> how
>> to do this) and call for each of them the "save" method. Is this 
>> possible?


That would work.  Or you could write:

    Dim obj As Object

    For Each obj In myCollectionName
        obj.Save
    Next obj

-- 
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

0
Dirk
4/5/2010 2:09:33 PM
I like your solution better. As usual.

Thanks!

Rocco

"Dirk Goldgar" wrote:

> "rocco" <rocco@discussions.microsoft.com> wrote in message 
> news:531AC139-8865-4705-95A9-F3B9D7C67F9C@microsoft.com...
> > it should be:
> > myCollectionName.Item(itemIndex).Save
> >
> > ...I guess...
> >
> > "rocco" wrote:
> >
> >> Hello,
> >> I have a collection of objects. Each object has few properties and few
> >> methods, among which: save, delete, recall and others.
> >> The "save" method of each object runs few private class functions to 
> >> double
> >> check data and if everything is fine it adds the data collected in few 
> >> tables.
> >> I would need a way to iterate the objects in the Collection (and I know 
> >> how
> >> to do this) and call for each of them the "save" method. Is this 
> >> possible?
> 
> 
> That would work.  Or you could write:
> 
>     Dim obj As Object
> 
>     For Each obj In myCollectionName
>         obj.Save
>     Next obj
> 
> -- 
> Dirk Goldgar, MS Access MVP
> Access tips: www.datagnostics.com/tips.html
> 
> (please reply to the newsgroup)
> 
0
Utf
4/5/2010 2:19:01 PM
Reply:

Similar Artilces:

Call in?
Do new owners of Office X have to call up Microsoft to register their copy? If yes, what's the number? thanks. Ming <asdf@asdf.com> wrote: > Do new owners of Office X have to call up Microsoft to register their > copy? If yes, what's the number? thanks. Nope. We're not using Windoze :->>> This version does not require activation. Corentin -- - Mac:MS MVP (Francophone) - (MS) MVP: http://support.microsoft.com/default.aspx?ln=FR&scid=fh;FR;mvp Newsgroups produits MS: http://support.microsoft.com/newsgroups/?ln=FR ...

ClearContents method on a passed range
I want to create a range of results in one worksheet based on a range of input values in another worksheet in the same workbook. I've 'named' the input and result ranges in Excel but am unable to clear the result range using the following code called from Excel with '=Test1(results)' speciified in a cell: Public Function Test1(RangeResult As Range) RangeResult.ClearContents End Function The code runs o.k. but the range isn't cleared and zero is returned. I thought I was getting the hang of VBA but this has stumped me. bryan wrote... >I want to create a range o...

Covered Call Options
Hello all, I do I go about dealing with a covered call transaction in Microsoft Money 2007 Premium? Currently what I am doing is inputing the option symbol, and choosing the transaction "Sell to Open" then when I go to expire the option I try to do a Sell to Close. However it does not seem to work? Also what happens if instead of expired I has the position assigned? how would I account for that? Thank you. Shhhh In microsoft.public.money, Shhhh wrote: > >I do I go about dealing with a covered call transaction in Microsoft >Money 2007 Premium? Currently what I am doing is...

Call center tracking and reporting
Anyone use CRM 4.0 for call tracking? Our Sales/Marketing is set up. Now I need to decide how to most efficiently customize CRM 4.0 for our company's call tracking portion. Can someone send me a link to information? thanks ...

telephone calls
when placing a telephone call using outlook, everything works fine except I can't hear the person i am talking to. They can hear me find. When I use a telephone program not associated with outlook every thing works great. can someone help ...

Calling Macro
Hi All, I have macro like this sub unique() '''''''' '''''''' Counter_item = 0 For Each Item In nodups counter_item = counter_item + 1 bic_var = Item Call Ps_Match Next Item end sub I have another macro Sub Ps_Match() ''''' ''''' If counter_item <= 1 Then call another_macro() end if end sub In the first macro i am declaring counter_item equals to 1. In my second macro i need to call that number. At the to of the module put: Public Counter_I...

Workflow -Assembly Call
How does add subtract in the Workflow>> assembly call works. I do understand that ypu can write your own custom workflows, register it and then call them from here, but I am pretty confused with the existing functionality. workflows can call other workflows workflows can also call a method in a .net assembly. ie you could write a piece of code in c# or vb.net and then have the workflow call your code. ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm "SAM" <SAM@discussions.microsoft.com> wrote in message news:DE...

Async calls to WebService in MFC
Hey guys, I use a webservice over the net which is scripted in VB.Net. This web service receives a username and a password and returns a string structure with multiples infos. If the string is empty, I had the wrong username and/or password. Pretty simple isn't? Ok now the problem is a bit more complex. I'm using an MFC client to connect to these web services, and since they're on the internet, there's a delay between sending the data and receiving an answer. I don't know really how I can tell me client to "wait for the string". The wrapper MFC created for the w...

Invalid procedure call or argument?
Hello All This is a re-post of a problem I posted a while ago, but to which I got no suggestions: hopefully I'll be more lucky this time!? I have the following code in a Private Sub: If InStr([ResponseXML], "element") > 0 Then errorfield = "Invalid " & Mid([ResponseXML], InStr([ResponseXML], "element"), InStr(InStr(InStr([ResponseXML], "element"), [ResponseXML], "'") + 1, [ResponseXML], "'") - InStr([ResponseXML], "element") + 1) Else .... Most of the time this works fine, but for some...

Unable to get DxgkDdiRecommendFunctionalVidPn call in windows 7
I am trying to add an initial vidpn topology by implementing the DxgkDdiRecommendFunctionalVidPn call in the WDDM miniport driver. But starting from windows 7 i am unable to get the DxgkDdiRecommendFunctionalVidPn function call from dxgkrnl.After searching through the MSDN documentation i found out that the function is deprecated starting from windows 7. msdn link: http://msdn.microsoft.com/en-us/library/ee220395.aspx According to msdn "On a computer running Windows 7, the display mode manager (DMM) determines an appropriate VidPN topology to apply using VidPN history d...

SystemMailbox Object User Missing
Our Exchange 2003 server is running fine. However, in one information store we have both the SMTP and System Attendant mailboxes but but the SystemMailbox is missing (is that okay?). In the other three Information Stores the SystemMailbox is there, but with no associated users. Most posts refer to http://support.microsoft.com/kb/316622 However when it discusses how to recreate the associated object user it explains how to create the SystemMailbox too. I already have those. Can't we reconnect the existing SystemMailboxes to the new user we just created in Exchange System Manager?....

application defined or object defined error on form
I have 2 forms. My main form which has a button to open another form(search form) and be able to select the customer that is to be viewed. I actually didn't create this form, a co-worker did and they are new to it. Well they renamed the form, table etc. It looks as if everything is changed correctly but for some reason my search form is erroring out. Not sure if it's because of the name change or something else. This selection worked before until this name change. So, On my search form, you can select a customer and click on the select button, which has this logic: varID = M...

Where to call SetWindowPos
In my SDI, can I place the following in CMainFrame::OnCreate( )? Or is there a better place? // ensure window opens on top when called by other applications, esp. the installer SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); Note that wndTopMost really means it is always on top and can never have another app come on top of it. So wndTopMost is often a poor choice. SetWindowPos would not be the best choice here; SetForegroundWindow would be better. joe On Sat, 11 Aug 2007 17:04:00 -0400, "SteveR" <srussell@removethisinnernet.net> wrote: >...

Call out to detect attaching files
Hi All, Is there a method to write a callout to detect file uploads. i knoe that when i file is uploading it's going to annotation entity. i have written preupdate and postupdate methods to track this. but when i add a file the event doesn't get fired and doesn't indicate the changes. later if i do a change to the note then i'm able to see the changes. can anyone tell me the reason... Thanks, Charith On Aug 7, 2:34 am, Charith <Char...@discussions.microsoft.com> wrote: > Hi All, > > Is there a method to write a callout to detect file uploads. i knoe tha...

Seeing a Parent's messages from a child object
I was wondering if there is any way for a child object to see the messages of a Parent object, like WM_SIZE. What i want to do is i'm creating a CFrameWnd object in a dll and i'm drawing that in on View of the calling exe. What i want to do is resize the CFrameWnd obj that's in my dll when the View of the exe is resized. I would like to do this without the View knowing this is happening. Any ideas or examples would be appreciated. Thanks Hi, Roth. You need to "subclass" parent window by your own interceptor WndProc which will return you whatewer you want. Tr...

World Wide Calling! Unlimited Incoming Calls.
New virtual access anywhere technology lets you call anyone, anywhere in the world, from any phone! Access: http://pt.telextreme.com/743499 ...

How do I do something called "track and change" in Publisher?
How do I do something called "track and change" in Publisher? thepantheistsboots wrote: > How do I do something called "track and change" in Publisher? You don't, there is no such feature. -- Ed Bennett - MVP Microsoft Publisher http://ed.mvps.org ...

OnKeyDown not called for VK_DOWN or VK_RIGHT but is called for others.
In my Dialog App on Win98 VC6 MFC, my OnKey is not called for VK_DOWN or VK_RIGHT but is called for others including VK_UP and VK_LEFT. Here is a portion of the Spy++ Log (I inserted blank lines to separate the key events). What could be causing this strange behavior? TIA Harvey ----- Spy Log: <00034> 0000030C P WM_KEYDOWN nVirtKey:'C' cRepeat:1 ScanCode:2E fExtended:0 fAltDown:0 fRepeat:0 fUp:0 <00035> 0000030C S WM_GETDLGCODE <00036> 0000030C R WM_GETDLGCODE fuDlgCode:0000 <00037> 0000030C P WM_CHAR chCharCode:'c' (99) cRepeat:1 ScanCode:2E fExtended:...

Add Property to MS VB Objects
In this case a picturebox? Currently I use a structure which tracks each picturebox and holds the variables I need. However, if it is possible to add a property to the MS Picturebox object, this structure could be eliminated. "David" <NoWhere@earthlink.net> wrote in message news:OeRQYOktKHA.5940@TK2MSFTNGP02.phx.gbl... > In this case a picturebox? > > Currently I use a structure which tracks each picturebox > and holds the variables I need. > > However, if it is possible to add a property to the MS Picturebox object, > this struc...

Call to a project from a MFC
Hello all, On the one hand I developped a MFC application (compile and execution ok). On the other hand I developped C++/C/Fortran routines (compile and execution ok). Now I would like to call, from the MFC application (e.g. on a click event), the routines. At first, I had problem with the precompiled header, and I solved it by entering "Project Settings, and not /Yu"stdafx.h" " for all non-MFC files. Now I got the following error : dfor.lib (DFORMAIN.OBJ) : error LNK2001: unresolved external symbol _MAIN__. I had a look at the FAQ and especially at (http://www.m...

LAST CALL to LUKE M
May I, please, have your E-Mai address ? I asked for it right beyond one of your replies, somewhere in this, or previous, page - but got nothing in return. If you don't want me to have it - just let me know - hereunder. Thanks, Micky micky-a<at>tapuz.co.il ...

Object reference not set to an instance of an object.
Hello, I have some code which simply reads a RSS with the XmlTextReader and XmlDocument. Unfortunaly I get the error: Object reference not set to an instance of an object. Here is my simple code: private function CheckRSS(byval strRSS as string) Dim reader as new XmlTextReader(strRSS) Dim xmlDoc as XmlDocument Try xmlDoc.Load(reader) Catch ex As Exception Response.Write("ERR in Rss File:" & strRSS & "<br>") Response.Write("Err: RSS File:" & ex.Message & "...

call flow
I'm looking for help with illustrating call flow through a large call center. Does anyone have a template I can use or any other help? call center flow tends to be pretty industry/function specific, and everyone wants to sell you their expertise in how it might be done.... try here for a university case study http://www.mark.umd.edu/~clay/OITACD_files/OITACD.htm al "Herbert" <hnmaddox@hotmail.com> wrote in message news:41FCDFF3-BA6C-4553-AC57-5847F38B9A1E@microsoft.com... > I'm looking for help with illustrating call flow through a large call > center. &...

My app calling API NetMessageBufferSend doesn't work recently!
Hi, I have an API call problem in VC6 to ask you for help. I wrote a LAN application to send pop up message between PCs in LAN as command "net send" does. I called Platform SDK API NetMessageBufferSend in my VC program: ....... success = NetMessageBufferSend( NULL, //pszServerName, wszMsgTo, wszMsgFrom, (LPBYTE)wszMsg, dwLen*2); ....... The wszMsgTo parameter is an unicode string for string such as "192.168.0.x". In fact, it worked fine some days ago while it fails to send message now. The return value "success" is 2273 NERR_NameNotFound. To my s...

Inserting Pivot Charts (OLE Object) into Publisher
I create a weekly email report using publisher 2007. In this report I insert pivot charts as OLE objects from Excel 2007. This is very resource intensive, utilizing up to 1gb of memory just for Excel when the copy and pasting is occurring. Using the OLE object allows me to resize the chart and maintain appropriate aspect ratios in the publisher template. But the resource issues and the amount of time it takes to do this as my system freezes up is killing my productivity. Any suggestions? I'm using a Lenovo T60 with 4gb RAM and a Centrino Duo processor. I am running the latest...