dynamic sub menus without command ids

Hi,

I am trying to create dynamic submenus without predefined command ids.
Having overridden OnMenuSelect, I dynamically generate the menu items (when
the correct menu to be opened), replacing an original dummy entry with the
id ID_DAR0:

     int c = pPopupMenu->GetSubMenu(MenuDARSubSub)->GetMenuItemCount();
     for(int x = 0; x < c; x++)
      pPopupMenu->GetSubMenu(MenuDARSubSub)->RemoveMenu(0, MF_BYPOSITION);
     for(int m=0; m<=m_pDoc->m_namenD.GetUpperBound(); m++)
      pPopupMenu->GetSubMenu(MenuDARSubSub)->AppendMenu( MF_STRING, ID_DAR0,
m_pDoc->m_namenD.GetAt(m));

Now all I need is a suggestion, on how to get the INDEX of the generated
submenu item, when clicked.

Every approach I have taken so far has failed, because somewhere along the
line, I need a distinct command id! If I where able to somehow get the index
of the item just clicked, everything would be fine. Something similar to
OnInitMenuPopup, but for menu items, would be ideal.

Thanks,

Thomas



0
cash1 (13)
1/29/2004 3:06:56 PM
vc.mfc 33608 articles. 0 followers. Follow

10 Replies
1025 Views

Similar Articles

[PageSpeed] 21

Thomas Noone wrote:

>Hi,
>
>I am trying to create dynamic submenus without predefined command ids.
>Having overridden OnMenuSelect, I dynamically generate the menu items (when
>the correct menu to be opened)

Why aren't you doing this in WM_INITMENUPOPUP?

>replacing an original dummy entry with the
>id ID_DAR0:
>
>     int c = pPopupMenu->GetSubMenu(MenuDARSubSub)->GetMenuItemCount();
>     for(int x = 0; x < c; x++)
>      pPopupMenu->GetSubMenu(MenuDARSubSub)->RemoveMenu(0, MF_BYPOSITION);
>     for(int m=0; m<=m_pDoc->m_namenD.GetUpperBound(); m++)
>      pPopupMenu->GetSubMenu(MenuDARSubSub)->AppendMenu( MF_STRING, ID_DAR0,
>m_pDoc->m_namenD.GetAt(m));
>
>Now all I need is a suggestion, on how to get the INDEX of the generated
>submenu item, when clicked.
>
>Every approach I have taken so far has failed, because somewhere along the
>line, I need a distinct command id! If I where able to somehow get the index
>of the item just clicked, everything would be fine. Something similar to
>OnInitMenuPopup, but for menu items, would be ideal.

You should reserve a range of IDs for this submenu and assign them to your
menu items. That is, instead of assigning ID_DAR0 to all of them, assign
ID_DAR0, ID_DAR0+1, ID_DAR0+2, etc. Then you can use ON_COMMAND_RANGE to
deal with their command messages.

-- 
Doug Harrison
Microsoft MVP - Visual C++
0
dsh (2498)
1/29/2004 5:12:23 PM
Thanks Doug,

this is my current way of doing things, but I am limited to the amount of
IDs I define in advance.

Apart from that fact: what would be the most elegant way of defining a large
range of IDs? Currently, I'm using dummy menu items. another reason I wanted
to avoid IDs.

Thomas


Doug Harrison [MVP] <dsh@mvps.org> schrieb in im Newsbeitrag:
9bfi10l9trb4r1a63l8rkuuufrp27ba466@4ax.com...
> Thomas Noone wrote:
>
> >Hi,
> >
> >I am trying to create dynamic submenus without predefined command ids.
> >Having overridden OnMenuSelect, I dynamically generate the menu items
(when
> >the correct menu to be opened)
>
> Why aren't you doing this in WM_INITMENUPOPUP?
>
> >replacing an original dummy entry with the
> >id ID_DAR0:
> >
> >     int c = pPopupMenu->GetSubMenu(MenuDARSubSub)->GetMenuItemCount();
> >     for(int x = 0; x < c; x++)
> >      pPopupMenu->GetSubMenu(MenuDARSubSub)->RemoveMenu(0,
MF_BYPOSITION);
> >     for(int m=0; m<=m_pDoc->m_namenD.GetUpperBound(); m++)
> >      pPopupMenu->GetSubMenu(MenuDARSubSub)->AppendMenu( MF_STRING,
ID_DAR0,
> >m_pDoc->m_namenD.GetAt(m));
> >
> >Now all I need is a suggestion, on how to get the INDEX of the generated
> >submenu item, when clicked.
> >
> >Every approach I have taken so far has failed, because somewhere along
the
> >line, I need a distinct command id! If I where able to somehow get the
index
> >of the item just clicked, everything would be fine. Something similar to
> >OnInitMenuPopup, but for menu items, would be ideal.
>
> You should reserve a range of IDs for this submenu and assign them to your
> menu items. That is, instead of assigning ID_DAR0 to all of them, assign
> ID_DAR0, ID_DAR0+1, ID_DAR0+2, etc. Then you can use ON_COMMAND_RANGE to
> deal with their command messages.
>
> --
> Doug Harrison
> Microsoft MVP - Visual C++


0
cash1 (13)
1/29/2004 5:35:32 PM
Thomas Noone wrote:

>Thanks Doug,
>
>this is my current way of doing things, but I am limited to the amount of
>IDs I define in advance.
>
>Apart from that fact: what would be the most elegant way of defining a large
>range of IDs? Currently, I'm using dummy menu items. another reason I wanted
>to avoid IDs.

I'd just pick a starting number outside the range ClassWizard normally
assigns to resource IDs, document the usage, and go from there. It's the
same sort of strategy that's necessary to use multiple MFC extension DLLs
which export resources in a single program. See these tech notes for more:

TN020: ID Naming and Numbering Conventions
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_MFCNOTES_TN020.asp

TN033: DLL Version of MFC
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_MFCNOTES_TN033.asp

-- 
Doug Harrison
Microsoft MVP - Visual C++
0
dsh (2498)
1/29/2004 5:49:42 PM
Now that I've implemented the menu update via OnMenuSelect, I have a very
annoying flicker.
Would you know of any way to stop the redrawing or update of the menu while
erasing and rewriting the menu items, using MFC?

Thanks,

Thomas

Doug Harrison [MVP] <dsh@mvps.org> schrieb in im Newsbeitrag:
ijhi10di7q8f631bdds55h2eu57o7r4nd1@4ax.com...
> Thomas Noone wrote:
>
> >Thanks Doug,
> >
> >this is my current way of doing things, but I am limited to the amount of
> >IDs I define in advance.
> >
> >Apart from that fact: what would be the most elegant way of defining a
large
> >range of IDs? Currently, I'm using dummy menu items. another reason I
wanted
> >to avoid IDs.
>
> I'd just pick a starting number outside the range ClassWizard normally
> assigns to resource IDs, document the usage, and go from there. It's the
> same sort of strategy that's necessary to use multiple MFC extension DLLs
> which export resources in a single program. See these tech notes for more:
>
> TN020: ID Naming and Numbering Conventions
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/
_MFCNOTES_TN020.asp
>
> TN033: DLL Version of MFC
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/
_MFCNOTES_TN033.asp
>
> --
> Doug Harrison
> Microsoft MVP - Visual C++


0
cash1 (13)
1/30/2004 8:34:16 AM
Thomas Noone wrote:

>Now that I've implemented the menu update via OnMenuSelect, I have a very
>annoying flicker.
>Would you know of any way to stop the redrawing or update of the menu while
>erasing and rewriting the menu items, using MFC?

I asked earlier, "Why aren't you doing this in WM_INITMENUPOPUP?" That's
normally where submenus are rewritten, and it's done before they're
displayed.

-- 
Doug Harrison
Microsoft MVP - Visual C++
0
dsh (2498)
1/30/2004 6:46:01 PM
You got me there!
I figured it out for myself, right after posting the message.
With InitMenuPopup everything works fine.
Except... now my menus won't disable anymore. Have to find out what I messed
up this time!

Thanks for your patience and help,

Thomas

Doug Harrison [MVP] <dsh@mvps.org> schrieb in im Newsbeitrag:
2h9l10p46tag5iracci56jc5otca16kuu7@4ax.com...
> Thomas Noone wrote:
>
> >Now that I've implemented the menu update via OnMenuSelect, I have a very
> >annoying flicker.
> >Would you know of any way to stop the redrawing or update of the menu
while
> >erasing and rewriting the menu items, using MFC?
>
> I asked earlier, "Why aren't you doing this in WM_INITMENUPOPUP?" That's
> normally where submenus are rewritten, and it's done before they're
> displayed.
>
> --
> Doug Harrison
> Microsoft MVP - Visual C++


0
cash1 (13)
1/30/2004 8:43:07 PM
Thomas Noone wrote:

>You got me there!
>I figured it out for myself, right after posting the message.
>With InitMenuPopup everything works fine.
>Except... now my menus won't disable anymore. Have to find out what I messed
>up this time!

You probably need ON_UPDATE_COMMAND_UI_RANGE. See this MSDN topic for more:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_Handlers_for_Message.2d.Map_Ranges.asp

>Thanks for your patience and help,

Hey, you're very welcome.

-- 
Doug Harrison
Microsoft MVP - Visual C++
0
dsh (2498)
1/30/2004 9:51:37 PM
I'm checking this through.
You see, initially my code already used ON_UPDATE_COMMAND_UI_RANGE and
ON__COMMAND_RANGE.
My goal was to do away with the predifined IDs. This doesn't seem possible.
Instead, I have generated 8x100 IDs like ID_DAR0 to ID_DAR99 with Excel,
instead of the 15 used until then, set them in the resource file, adapted
the above two commands and moved the menu building routines to
OnInitMenuPopup.
And now, not one menu will grey. This includes ALL menus in the application,
not just those covered by above commands.

So I've got todays work cut out for me.

Thanks for your help,

Thomas



Doug Harrison [MVP] <dsh@mvps.org> schrieb in im Newsbeitrag:
64kl10167i2oi5dte97rto9i8761achs6e@4ax.com...
> Thomas Noone wrote:
>
> >You got me there!
> >I figured it out for myself, right after posting the message.
> >With InitMenuPopup everything works fine.
> >Except... now my menus won't disable anymore. Have to find out what I
messed
> >up this time!
>
> You probably need ON_UPDATE_COMMAND_UI_RANGE. See this MSDN topic for
more:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html
/_core_Handlers_for_Message.2d.Map_Ranges.asp
>
> >Thanks for your patience and help,
>
> Hey, you're very welcome.
>
> --
> Doug Harrison
> Microsoft MVP - Visual C++


0
cash1 (13)
1/31/2004 8:34:09 AM
Seems I needed to call CFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex,
bSysMenu ) on exiting OnInitPopupMenu.

Thomas Noone <cash@cash-gmbh.de> schrieb in im Newsbeitrag:
uNggXR95DHA.3664@tk2msftngp13.phx.gbl...
> I'm checking this through.
> You see, initially my code already used ON_UPDATE_COMMAND_UI_RANGE and
> ON__COMMAND_RANGE.
> My goal was to do away with the predifined IDs. This doesn't seem
possible.
> Instead, I have generated 8x100 IDs like ID_DAR0 to ID_DAR99 with Excel,
> instead of the 15 used until then, set them in the resource file, adapted
> the above two commands and moved the menu building routines to
> OnInitMenuPopup.
> And now, not one menu will grey. This includes ALL menus in the
application,
> not just those covered by above commands.
>
> So I've got todays work cut out for me.
>
> Thanks for your help,
>
> Thomas
>
>
>
> Doug Harrison [MVP] <dsh@mvps.org> schrieb in im Newsbeitrag:
> 64kl10167i2oi5dte97rto9i8761achs6e@4ax.com...
> > Thomas Noone wrote:
> >
> > >You got me there!
> > >I figured it out for myself, right after posting the message.
> > >With InitMenuPopup everything works fine.
> > >Except... now my menus won't disable anymore. Have to find out what I
> messed
> > >up this time!
> >
> > You probably need ON_UPDATE_COMMAND_UI_RANGE. See this MSDN topic for
> more:
> >
> >
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html
> /_core_Handlers_for_Message.2d.Map_Ranges.asp
> >
> > >Thanks for your patience and help,
> >
> > Hey, you're very welcome.
> >
> > --
> > Doug Harrison
> > Microsoft MVP - Visual C++
>
>


0
cash1 (13)
1/31/2004 9:33:23 AM
Hi Thomas,

Thanks for posting in the community. 

How are the things going? Do you have resolved your problem? 
If you have any more concerns on it, please feel free to post here.


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

0
v-garych (605)
2/3/2004 2:41:29 AM
Reply:

Similar Artilces:

do you know commands for when importing text file into visio 2000
Hi, I am trying to create visio file by importing *.csv files into visio 2000. I have had limited success, but I want to connect the shapes--from the stencil sheets--together. Does anyone have any documentation about this? From the basic flowchart stencil sheet, i can link together two process shapes with a connection. But I do not know how to connect an annotation shape to a process shape. I also do not know how to put two words on different lines for an annotation shape. I know it's confusing, but I have an example of what I am trying to do. The following is a *.csv text file. Put...

550 Error: invalid Message-ID header
Hi, I've had some mail delivery failures using Outlook (2002) lately in which the message reads: 550 Error: invalid Message-ID header Message-id: !~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAtoq+3x8xNUO1MiZ1OYDvBMKAAAAQAAA AEWj42B48R0eHwslYhvJOyQEAAAAA@myproviders.com Admittedly, it appears to be long but it has never given anyone a problem before. I tried both of my ISP's and the result is the same. The only difference I see in the headers is that these folks are now using "MailEnable Postoffice Connector" Is there anything I can do at my end before I start botheri...

Laser printers that support check printing (MICR?) from Dynamics GP
I am looking for a list of laser printers that can support check printing by Dynamics GP. We are using dot-matrix on pre-printed form and got tired of them! Your help is greatly appreciated. Bill Are you using Mekorma MICR Check Printing? If so the documentation has list of laser printers. "Bill N" wrote: > I am looking for a list of laser printers that can support check printing by > Dynamics GP. > We are using dot-matrix on pre-printed form and got tired of them! > > Your help is greatly appreciated. > > Bill > > . >...

Event ID 9666
I get this warning in my app event logs. This is a W2K3 Exch server cluster. Event Type: Warning Event Source: MSExchangeIS Event Category: General Event ID: 9666 Date: 12/13/2005 Time: 10:19:00 AM User: N/A Computer: SERVERNAME Description: The number of named properties created for database "First Storage Group\Mailbox Store (SERVERNAME)" is close to quota limit. Current number of named properties: 16364 Quota limit for named properties: 16384 User attempting to create the named property: "SYSTEM" Named property GUID: Named property name/id: "X-NJ-IPM-Conten...

(exchange 5.5) Postmaster E-mail ID
Hi I want to change Postmaster E-mail ID with new Domain name, how to do this . Thanks Shaikh ...

Drop down menus in EXCEL
Any experts out there who can help with drop down menus in EXCEL? I have a fairly major project to complete over the next weekend and need some help. I am a semi competent EXCEL user but haven't used DDMs before. Basically I need to 1. Offer a selection of comments via 3 or 4 drop down menus (can you choose more than one option from each?), 2. Collate the responses in a worksheet, 3. Export the replies to a table in WORD. Any guidance or support very much appreciated, B Hi just to get you started: http://www.contextures.com/xlDataVal01.html and also search Debra's e...

Event ID: 8231 and 8213 in exchange 2003
Hello, running into multiple event errors on server always recurring the same 2, Every 5 minutes i get 3-4 new events with ID 8231; Event Type: Error Event Source: MSExchangeAL Event Category: Service Controller Event ID: 8231 Computer: RootServer Description: Permanent failure reported by policy group provider for 'CN=Recipient Policies,CN=Exchange_Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=DOMAIN-A,DC=com':'MAD.EXE', error=80040103. Taking provider offline. Every 25 minutes i get 1 new event with ID 8213; Event Type: Error Event Source: MSExchangeF...

Open A Sub-Form Using A Combo Box
I have a main form, frmEmployee, to record employee detail, one of which is a combo box, Position. I also have a sub-form for each position. Is there any way of changing the sub-form in the main form to match the position selected? Regards Nick To change the sub form try Me.[SubFormControlName].SourceObject = "SubFormName" Using the AfterUpdate event of the ComboBox -- Good Luck BS"D "Nick hfrupn" wrote: > I have a main form, frmEmployee, to record employee detail, one of which is a > combo box, Position. I also have a sub-form for each position. &g...

mail ids from contacts are not suggetsed
Hi, I've added all my mail ids to "contacts". But when i try to write a new mail, mail ids from contacts are not suggested, instead the ids whom i sent mails before are suggested. Is there any setting option AutoSuggest is not the same as Automatic Name Checking. AutoSuggest is a cache of addresses you used before which is independent from the Contacts folder. This will display a drop down list. Automatic Name Checking tries to resolve addresses for names that you have typed from your Address Book. If it is unsuccessful or when multiple entries are found it will prompt yo...

how do i carry a balance to next row without it continuing down?
i have made a worksheet that adds and subtracts across the row, each row is a month, then the balance in the last colunm jumps down to the next row (month)first column. everything works great but i don't want the balance for the next month continuing down to the each month same for the ending balance. what i want is to have it end each time with just the beginning balance for the coming month, then as i add a percentage rate it will add across the row and put the ending balance in the next row (month) i hope this make sense ...

Sending a captured .dib file to an image box without storing it
I want to use a command button, say "cmdDisplayImage" to display/ transfer a captured image from the ezVidCap1 control to an image or OLE box on the same form such as "PhotoPreview" (not sure which one is possible/best...perhaps someone can help me...I'm new at this.) I really don't want to "save" it first. Then, I want another command button such as "cmdSaveImage" to save the file to a folder (such as \\Server\Database\Images when the user clicks another command button when they have the image they want in the "PhotoPreview" box. R...

ID replicaiton from E2k3 to E55 stopped
Replicaiton of any new IDs from E2k3 to E55 has stopped. I have logging turned to max and I don't see any errors. Intrasite full replicaiton has been run, multiple attempts at service/server restarts attempted. What am I missing here? Help... do you mean the ADC replication? "Cosmo" <ckramer2k@hotmail.com> wrote in message news:185701c499e7$0a06f620$a501280a@phx.gbl... > Replicaiton of any new IDs from E2k3 to E55 has stopped. > I have logging turned to max and I don't see any errors. > Intrasite full replicaiton has been run, multiple > attempts at ser...

How do I enter a date in excel without "/" ex. 041504 will show 0.
Excel can't do this without some help. You could look at: http://www.xldynamic.com/source/xld.QDEDownload.html for an addin that can set this up. tj "Amy" wrote: > ...

Query Builder (SQL View)
I am trying to join 2 tables. I want to join if 'Field B' is in 'Field A'. ie. Field A = 'ABCDE' Field B= 'BC' ....the join would be successful cause 'BC' is in 'ABCDE'. Is this possible? I tried... SELECT FROM table1 INNER JOIN table2 ON table1.name like (% table2. partial_name %); Keep getting errors. Any help greatly appreciated! Warren Depending on the "flavor" of SQL you are using SELECT * FROM table1 INNER JOIN table2 ON table1.name like '%' & table2.partial_name & '%' Or SELECT * FROM table1 IN...

Clear Exchange 2003 SMTP queues without losing good inbound and outbound email
Previous tips and techniques mention how to clear the Exchange 2003 mail queues after a reverse NDR attack, or if your server was accidentally left open as a relay. Clearing these queues can take a VERY long time manually, and clearing the queues automatically usually causes some loss of inbound and outbound mail that is VALID. The following technique will allow you to clear the queues of ONLY bad messages: 1. Stop SMTP service on Exhcange server. 2. Navigate to SMTP queues directory (by default, C:\PROGRAM FILES\EXCHSRVR\Mailroot\VSI 1\QUEUE) 3. In Windows Explorer, right-click the QU...

SQL Command to enter picturei for supplier
I want to add a picture to all items from a particular supplier. For example, I have a coke logo, and forall items where primary supplier is "Coke" I want to use picture coke.jpg. I don't want to manually add the filename to each item... Any help? Hi Jason...we have a tool that wil make this a snap called the Product Attribute Manager (PAM). Basically its a mass item editor for RMS. We use it for our web integration, but you could use it seperatley of course. Please email me at todd.jensen@nitrosell.com or call my office 480-968-7798. All the best, Todd Jason wrote: >...

How to use Windows command within Excel macros
Hi, I want to select a bunch of text data separated by commas from a website, use Windows copy command to copy and paste it into a worksheet in Notepad and save it as a text file. How can I do that? That's all. In case you want to know further, I then can open the text file within Excel as a comma delimited data and manipulate it as much as I like. Thanks for any help. TIA Tom Hi Tom --From 'Insert' menu select 'Object' --Select 'Word Pad Document' --Select 'Display As Icon' if you want.. --Edit,save etc; as you want -- ...

Formatting currency with the cents but without the decimal point
I have a client who needs to export check information in a text format. The bank is requiring that all fields take x number of characters, which I have been able to do except that the check amount needs to read 10 digits without the decimal place. ie: $247.84 becomes 0000024784. I can get it to 00000247.84 with the function Format([CkAmount],00000000.00) but the minute I take out the decimal, I get a decimal, I get 0000000247. I should also mention that this is an Access 97 db that has to be totally redone at some point in a later version. It won't convert to any higher a ...

How get to end of document without scrolling?
How get to end of document without scrolling quickly? Ctrl + End -- Regards, Peo Sjoblom "cb" <cb@discussions.microsoft.com> wrote in message news:71E71871-C5BD-4100-8B34-39D6A81ED8F6@microsoft.com... > How get to end of document without scrolling quickly? THANKS IT TAKES ME TO THE RIGHT i NEED TO GO TO THE BOTTOM OF LIKE 600 ROWS "Peo Sjoblom" wrote: > Ctrl + End > > > -- > > > Regards, > > > Peo Sjoblom > > > "cb" <cb@discussions.microsoft.com> wrote in message > news:71E71871-C...

Unclick Code on Check box command button
I have code written that when the control check box is selected certain cells will highligh. I would like for those same cells to turn white when the check box is unchecked. What code do I need? Thanks! Private Sub CheckBox1_Click() Range("B17:D17").Select With Selection.Interior .ColorIndex = 6 .Pattern = xlSolid .Value = 0 End With End Sub How about checking if the checkbox is checked or not checked <vbg>? Option Explicit Private Sub CheckBox1_Click() With Me.Range("B17:D17").Interior If Me.C...

Without further a-doodoo, the stock/forex/penny forecast for Thursday has arrived!
Without further a-doodoo, the stock/forex/penny forecast for Thursday has arrived! Stock: CHECKPOINT SYSTMS: URL: http://stocktruth.com/?stock=nyse&symbol=CKP Forex: CAD/USD http://stocktruth.com/?stock=forex&symbol=CADUSD=x Penny: ADSTAR INC (not so hot) http://stocktruth.com/?STOCK=otcbb&symbol=ADST ARIA: (nice but close to $4) http://stocktruth.com/?stock=nyse&symbol=ARIA Disclaimer: This is ancient history (literally). All of these reports are based on historical matches. The computer does not read the news! Do your own research and eat an apple every...

Error when trying to close case without sufficient allotments
After upgrade from 1.2 to 3.0 I'm getting error when trying to close case without sufficient contract line allotments. This worked fine with 1.2. When we closed case it marked Allotments Remaining as -33 minutes. Here is error message: [COMException (0x800404ef)] Microsoft.Crm.Platform.ComProxy.CRMIncidentClass.Close(CUserAuth& Caller, String ActivityXml, String PartiesXML, Int32 Status) +0 Microsoft.Crm.Application.Platform.Incident.Close(String activityXml, String partyXml, Int32 status) +213 Microsoft.Crm.Web.CS.CaseDetailPage.Close(Object sender, DataEventArgs e) +...

Event Sub when one specific cell changes
Hi, I am using Excel 2007. I have written a VBA Sub that I want to be called any time the value in one particular cell is changed. I know I can do this by creating a Worksheet_Change() Sub and checking the 'Target' Range parameter to see if the changed cell is the one I want to watch. The drawback of this is that this Sub gets called any time *any* cell is changed. In my case, this will get called alot because I have a value in another cell that changes once per second (it displays the current time). I was wondering if there is an event Sub other than Worksheet_...

set report field forecolour based upon corresponding id entry in a 2nd report
hi, just joined..beginner i'm afraid.. if i have just read 'access help' properly it appears i should use condtional formatting to change a field colour in one report provided the 2nd report is open...can you advise the neccessary code format to use to refer to a 2nd report please as i'm not a programmer..hope this isn't too janet & john!.. thanx in advance, mike ...

Opportunity Unique ID
We are using CRM 4.0 and it would be really useful to create a reference field that automatically creates a unique ID. I can't work out how to do this - any ideas? Thanks I recently used the following code as a simple method to create a unique Id for the Account form's AccountNumber attribute. It may not be the best way to do so, but it worked for me: // Generate Account Number if (crmForm.FormType == 1) { var aName = crmForm.all.name.DataValue; aName = aName.substr(0,3); aName = aName.toUpperCase(); var iNum = Math.random(); iNum = iNum.toString(); iNum =...