Form Controls vs VBA controls

I am new to VBA so just finding my feet, can anyone help me with th
differences between an excel control (i.e. one from the form toolbox
lets say a checkBox and a vba checkBox? 
From trying the two controls the I have noticed is that you canno
capture the change event of the VBA checkbox in the code module, it ha
to be done via the sheet (i.e. checkbox on sheet1, code goes in chang
event on sheet1) the control is placed on, is this correct? What woul
you do if you have three sheets with the same controls just differen
data, do you really have to code the control 3 times?

The excel control however you can code a module to capture the chang
event but cannot reference the checkbox directly as i
activesheet.checkbox1.value, is this correct?

I am trying to decide which is the best 'toolbox' to use for a vba app
trying to ensure the code is not tied to a specific sheet. Not sure i
this is possible using these controls

--
cmpcwil
-----------------------------------------------------------------------
cmpcwil2's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3341
View this thread: http://www.excelforum.com/showthread.php?threadid=53410

0
4/19/2006 12:47:09 PM
excel 39879 articles. 2 followers. Follow

1 Replies
1770 Views

Similar Articles

[PageSpeed] 5

See responses in .programming.

-- 
 HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"cmpcwil2" <cmpcwil2.26ii1a_1145451001.17@excelforum-nospam.com> wrote in
message news:cmpcwil2.26ii1a_1145451001.17@excelforum-nospam.com...
>
> I am new to VBA so just finding my feet, can anyone help me with the
> differences between an excel control (i.e. one from the form toolbox)
> lets say a checkBox and a vba checkBox?
> From trying the two controls the I have noticed is that you cannot
> capture the change event of the VBA checkbox in the code module, it has
> to be done via the sheet (i.e. checkbox on sheet1, code goes in change
> event on sheet1) the control is placed on, is this correct? What would
> you do if you have three sheets with the same controls just different
> data, do you really have to code the control 3 times?
>
> The excel control however you can code a module to capture the change
> event but cannot reference the checkbox directly as in
> activesheet.checkbox1.value, is this correct?
>
> I am trying to decide which is the best 'toolbox' to use for a vba app,
> trying to ensure the code is not tied to a specific sheet. Not sure if
> this is possible using these controls?
>
>
> -- 
> cmpcwil2
> ------------------------------------------------------------------------
> cmpcwil2's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=33411
> View this thread: http://www.excelforum.com/showthread.php?threadid=534108
>


0
bob.phillips1 (6510)
4/19/2006 2:48:19 PM
Reply:

Similar Artilces:

Controls vs. handles
It seems that when I've got a dialog with controls in it the IDC_* names I provide are actually handles that can be used by some functions to refer back to the control. How do I manage to address the control object directly so I can apply its own methods rather than an external function. IOW, what is the name of the object? TIA, Lilith Those IDC's are constants used to write the resource file - simple integers, look in resource.h If you have a control variable (Set up through the dialog editor) and want to get its DLGID use GetDlgCtrlID( ). Are you creating them on the fly? I...

adding field to form
Hello, I have made continiuse form with 10 field that works (text box in detail and lables in form header) but when i want to add one more field that text box is in detail part of form and lable in form header part ,I can not save my form.and access goes to repair mode after saving and there is no change when I reopen my form. thanks. ...

How to insert a realplayer G2 control into a rich edit control?
I try to insert a realplayer G2 control into a rich edit control but failed. There is only a blank rectangle. Please help here. +++++++++++++++code begin+++++++++++++++ CTestEmbedActiveXView *pView=(CTestEmbedActiveXView *)GetActiveView(); pView->GetRichEditCtrl().ReplaceSel(_T("begin insert a realplayer activex control.\n")); LPSTORAGE lpStorage=NULL; LPOLEOBJECT lpObject=NULL; LPVIEWOBJECT2 lpViewObject=NULL; LPDATAOBJECT lpDataObject=NULL; RECT rc; rc.left=0; rc.right=300; rc.top=0; rc.bottom=100; BOOL bResult=m_realplayer.Create(NULL,_T("realplayer wnd&...

Malicious Code error when opening a custom outlook form
After installing Visio 2003 on XP Professional with Microsoft Office 2002 installed, I get the following error when I launch a custom outlook form... "To help prevent malicious code from running, one or more objects in this form were not loaded. For more information, contact your administrator." Has anyone seen this or know how to address it? ...

change the default opening of a form to enter a new record
How can you stop a form defaulting to record 1 when you want to type in a new record. The only way we are getting round this at the moment is to click on the icon New record. However, every time we open the form to enter another record it is always showing record 1 -- Thank you for reading my post. Hopefully you can answer my querie Shazza - Set the form property Data Entry to Yes. That will default to opening the form for new records. -- Daryl S "Shazza" wrote: > How can you stop a form defaulting to record 1 when you want to type in a new > r...

How to add multiple controls in view?
Hi, I am following this example to create controls in my view, as describe here http://dev-www.codeguru.com/atl/windowless.shtml.I can create only one control,how can i create multiple controls in view,I am using this code in OnIniatialUpdate but i can see only one control. By the way i am trying to make designer applicantion like VB/VC resource editor. Regards. dilbir My code ... m_pCtrl = new CWindowlessControl; m_pCtrl2 = new CWindowlessControl; if (m_pCtrl->m_hWnd == NULL) { CRect rect(40, 40, 200, 200),rect2(80,80,200,200); // VERIFY(m_pCtrl->CreateControl("{CE9...

VBA to convert PowerPoint presentation to Word
I'd like to create a VBA macro to extract all content from a Windows PowerPoint 2003 document and place it in a Word 2003 document, as Word to PDF conversion seems to provide better-quality tagging than a PowerPoint to PDF conversion. I know I can save the outline as RTF and open that in Word, but the outline does not include any of the following: - text added on a blank slide layout - text in a text box - tables. - images. Is there any way to copy all content from a PowerPoint presentation to a Word document, such that all text remains text and all tables remain as ...

HELP: Excel userform version control issue
Hi All, I have an excel userform that is posted on my companys intranet. The issue I am having is, users are saving this form to their hard drive and then using it(Instead of launching it everytime from intranet), SO basically when I have a new version of form on intranet they still use the old version as they have a habbit of saving it on their hard drive. Is there a way to resove this? something like they would see a popup message saying that "This is an older version that you are using, Please launch the form from Intranet for newer version". Thanks in advan...

Search Form
I have read some help articles on sub forms, however, have yet to find the solution that helps me. Some groups have stated that this is not known, however I know there has to be an easy solution: I have a form that also has a subform. The two are linked by a field, [Eno]. When I add records, etc, everything works beautifully. However, If I wanted to search the form from a SUB-FORM field [EMPLOYEE] from the MAIN form, It will now work. I started the search with a unbound text box, - after update which will be the search terms, however, I am trying to figure out VBA code that will ...

Re: How can I stop Outlook to run subsequent rules from VBA function bound to currently running rule
And I thought to use Rule's olRuleActionStop in VBA. . Submitted using http://www.outlookforums.com ...

Naming worksheets...new to VBA
Hi, I'm pretty new to VBA and need to create a simple macro. When the command button it is linked to is clicked...I need it to search a workbook for the highest numbered worksheet (ex. "G4" was the highest sheet so the macro will create G5) and then create a new worksheet. This might be a simple problem but any help is appreciated. Thanks, Mjack --- Message posted from http://www.ExcelForum.com/ Try this Mjack Sub test() Dim Shcount As Long Shcount = Sheets.Count Sheets.Add after:=Sheets(Sheets.Count) ActiveSheet.Name = "G" & Shcount + 1 End Sub -- Regar...

summing in a form..
In my form i have Beginning Mileage, Ending Mileage, Total Daily Mileage. As of now I have to enter Beginning Mileage, my Ending Mileage is =Nz([AR],0)+Nz ([LA],0)+Nz([TX],0)+Nz([MS],0)+Nz([OK],0)+Nz([Other])+[Beginning Mileage]. my Total Daily Mileage is =Nz([AR],0)+Nz([LA],0)+Nz([TX],0)+Nz([MS],0)+Nz([OK] ,0)+Nz([Other]). Is there a way that i can make my Beginning Mileage carry over from the previous record (so i wouldnt have to manually enter it)? Thanks -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200705/1 Thanks for the reply. T...

Nitrosell (weblinx) vs. Storefront.net
Users please comment on your pro and con experiences with these systems. I have all the marketing materials from the manufactirers and partners. We have narrowed down our search to these 2. I am leary of the recurring costs of Nitrosell. I am also afraid of the coordination between 3 separate software packages that must work together to link RMS to Storefront (using Newest's program). Actual experiences would be most helpful! I need eBay payment ability through the webstore and affiliate support also. If a stand-alone program works with the web store, that would be OK too but I wou...

Customize Exchange 2003 OWA Custom Forms for Contacts
We have just created a custom form for contacts and would like OWA to show the custom fields in OWA. How do we do this? Thanks ...

A Static linked control problem
Hello Everyone, I have a problem with static-linked library in my MFC based project. The structure of the projects is like this: MainControl project contains MainControl.cpp and mainControl.h HeadApp.project contains all application files, and the AppDoc class here (created by MFC wizard) contains the MainControl object: CMainCtrl *m_control; It compiles fine intill I try to create the control on Runtime: m_control = new CMainCtrl(); Here I get an unresolved external symbol error, even if I write the exact path to the MainControl header file.. What's wrong? Thanks for your time.. ...

determining which control fires a message
Hello, I have a simple dialog app with a number of buttons. Each button performs basically the same function. I want to have each BN_CLICKED message call the same function, determine which button was pressed, and act accordingly. I can't seem to find a way to trace back to the message- generating button's ID. Is this possible? Thanks, J. Look up ON_CONROL_RANGE macro. Ali R. "J Crafton" <jccrafton@yahoo.com> wrote in message news:039f01c39e50$cbce67e0$a101280a@phx.gbl... > Hello, > > I have a simple dialog app with a number of buttons. &g...

Multiple messages for single selection change in list control
Hi, In the handler of LVN_ITEMCHANGING (OnItemChanging...()), how can I deduce which messages belong to the same event? I am interested in the change of an item selection state, but it seems that an irregular number of messages are sent for one such event. In some cases I would like to substitute *pResult = TRUE in order to cancel the change, but I still receive the rest of the messages for that same event. For those messages I should also set *pResult = TRUE, but how can I know which messages belong to the same event? I cannot figure out the logic of the number of messages sent for a single ...

How to tell when Bill Payment is done electronically vs. paper check?
Am I correct in thinking that if I pay a bill via an epay, and I never get a paper check in return from my bank, then the payee was paid electronically, i.e., the payment to the payee never involved any paper check anywhere through the process? I recently switched from MSN Bill Pay to my bank's bill pay service (I send payments from within M03 for both). There's a piece of information missing for me when I switched to using my bank as the bill payer: I don't have a list of 'participating billers' (such as on the MSN Bill Pay website). Unless I determine who the t...

PRINT INVISIBLE FORM
Hi All, I have a form A that I sometimes print using the printout command, after passing some parameters and making calculations. I want to print the same form A from another form while making form A invisible. How should I do this? -- Glint You should create a report from form a and print that instead of the form. That way you don't have to hide anything. Reports are meant to be for printing. Forms are meant for data-entry and showing data... -- Maurice Ausum "Glint" wrote: > Hi All, > I have a form A that I sometimes print using the printout command, after >...

Annual return calculation hosed vs. me being stupid
I need to know which. I've been trying to transfer an IRA account from an old financial institution that doesn't have online services to a new one that does. If I follow explicitly the instructions MS gives to do this, I lose the transaction history and cost basis of the underlying investments. It simply sets up a new account. If I set up a transfer instead, I keep the cost basis and it's accurate, but I find I'm now earning an average annual return of around 3000% on the underlying mutual funds... the small cap fund is booming along nicely at 52000%. Needless to say I...

Add Record from form into two tables
I have a form (frm_Invoice) that records phone serial # from customers. I want to create a new record in both the tbl_Inventory and tbl_Inventory_Detail when someone scans in a DEC_SN into the frm_Invoice. The issue I am running across is that the tbl_Inventory_Details has a child relationship to the tbl_Inventory. I chose this set up because most of the inventory is manually entered from shipments received from a warehouse. I created a form and sub form for the inventory tying the SN_ID from each table on a one to many relationship. I do not know how to update both tables at ...

Printing in Win NT vs Win 2000
When printing a document in NT, it is coming out differently than from 2000. It doesn't matter what printer you print to. I've tried 4 different printers so far. The option in Excel is fit to 1x1 page. Any ideas? Thank you. Kathy I'm afraid it is difficult to get prints the same from different printers and operating systems as the drivers will be different all round. Excel uses setting from the drivers. You could try and ensure that all same printers have all same version of drivers for each operating system. (Normally manufacturers release them all together for Winx) ...

picture control as background
Hello, when I put picture control into Dialog box and then add some buttons, they are not visible until clicked, is it hard to set this bitmap in picture control as background? thanks You have created the dialog with the bitmap in front and the buttons in back. Unfortunately, due to a more-than-decade-long bug Microsoft refused to fix until VS.NET, the Z-order of controls at design time in VS6 and lower is the OPPOSITE of the runtime Z-order, so just make the bitmap be the highest tab value instead of the lowest (note that at design time this means it covers the buttons!) joe On Thu...

Sent items separates messages
Hi: I have a contact in my address book with the full name of "Steve Smith" and an email address of "ssmith@hiscompany.com" When I receive email messages from Steve, in my inbox, his messages show up with the "From" name of "Steve Smith" - exactly as I would expect. If I REPLY to a message from Steve, then in my "Sent Items" folder, the message sometimes appears with the "To" name of ssmith@hiscompany.com and other times it appears with the "To" name of 'ssmith@hiscompany.com' (notice the single q...

How do I set up a Startup Form with Access 2007 ?
Hi When I open a database, I want a certain form to start. This form is going to be used for a menu. Please let me know. Thanks Mark Create a macro named Autoexec. Have action open your form. -- KARL DEWEY Build a little - Test a little "mthornblad@gmail.com" wrote: > Hi > > When I open a database, I want a certain form to start. This form is > going to be used for a menu. > > Please let me know. > > Thanks > Mark > > On Aug 13, 5:24 pm, kasab <ka...@discussions.microsoft.com> wrote: > Alternatively, click the Office button ...