Passing option group value to vba function

I'm sure I've done this before but can't for the life of me figure it
out now, and hours of research online haven't helped. I'm simply
trying to pass an option group value from a form to a vba function.
I'd like the user to choose option1 or option2 and when they click a
button, the function will run an if statement like "if
option1.value=true then...."

I've got 2 options named option1 and option2 and a frame called
frame20, what else do I need? I've also tried bounding the selection
to a textbox, but keep getting errors. Any help on the process?

Thanks,
Angelo

0
Muscat
8/6/2007 2:57:33 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
7553 Views

Similar Articles

[PageSpeed] 18

If you set up the function as below, you can call it like this:
    Call MyFunc(Me.frame20)

Function MyFunc(grp As OptionGroup)
    Select case grp.Value
    Case 1
        MsgBox "Option value is 1."
    Case 2
        MsgBox "Option value is 2."
    Case Else
        MsgBox "Huh?"
    End Select
End Function

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<Muscat.Angelo@gmail.com> wrote in message 
news:1186412253.685239.159910@o61g2000hsh.googlegroups.com...
> I'm sure I've done this before but can't for the life of me figure it
> out now, and hours of research online haven't helped. I'm simply
> trying to pass an option group value from a form to a vba function.
> I'd like the user to choose option1 or option2 and when they click a
> button, the function will run an if statement like "if
> option1.value=true then...."
>
> I've got 2 options named option1 and option2 and a frame called
> frame20, what else do I need? I've also tried bounding the selection
> to a textbox, but keep getting errors. Any help on the process?
>
> Thanks,
> Angelo
> 

0
Allen
8/6/2007 3:15:32 PM
Reply:

Similar Artilces:

Is It Possible To Pass Parameters to A Pass Through Query
My assumption is that's it's not. At work I use ODBC to connect to our oracle database with Access 2003. There are cases where using a pass through query runs much much faster and I then use it in a make table query to make a local table. In access you can use brackets [] to have it ask for input. May I assume there is no way to do anything like that in a pass through query? Create a PassThrough query and use code to assign the SQL to this query filtering it with a parameter, and then run it e.g Dim MyVariable As Integer MyVariable = InputBox("Please select a Number&quo...

Avoid drawing blank values
Hello, Can you tell me if there is a way to plot only non-blanked values from a table: F.e. if: X= 1,2,3,4 Y=10, ,10,10 (so no value for x=2) I want to obtain a continuous line going from the first point (1,10) to the third point (3,10) and then of course to (4,10). Thanks in advance for your help, Iv´┐Żn ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ On Mon, 10 Nov 2003 10:52:34 -0500, ivarela1 = <ivarela1.woqln@excelforum-nospam.com> wrote: > Can you t...

Excel VBA Macro executing half-way
Hi, I have a macro which I run regularly and successfully until last couple days when it stopped executing half-way. This also happened to other macros as well. I debugged the macro and it stopped at certain line but gave no error, then started from the beginning of the code. Thank you for any comment. TIA Agustus ...

How to count an age group
Sorry, I am trying to do this operation: in cell F7 I have the following datas corresponding to peoples age how can I count the numbers of time its ocurrs eg. of 50-<70 50-<70 50-<70 17 <30 30-<50 70+ 17 <30 I also need to know the percentage of each of them, how often they have been in that cell. I appreciate if any good soul can help me. Cheers -- just arrived! Hazarding a guess that a pivot table is quite ideal for what you seek to do. It's easy n fast to set-up Here's the play to tinker with (steps in xl2003): Presume that you have age data (as posted) i...

PivotTable buttons remembers old unactual values
I have discovered that buttons in the row area remembers old values not longer existing in the data. Ex: I have 4 persons with initials "aaa", "bbb", "ccc" and "ddd" I have the Initial button in the row area. When I click on the arrow of the "Initial"-button, it gives me the possibilities: "(Show all)", "aaa", "bbb", "ccc" and "ddd". If I change initial "ddd" to "xxx", refresh the pivot table and again click on the arrow of the "Initial"-button, it gives me the p...

Do not display Value label if value = zero
Hi I am putting together a pie chart, where values for some slices is 'zero'. The zero slice is not visible, but the label still appears '0%'. Is there any way of suppressing this label for the zero slice only (so the other slices still have value labels appearing) ? Many thanks for any help Format label, custom format: #;;; -- Best Regards, Luke M "LFNFan" <LFNFan@discussions.microsoft.com> wrote in message news:CC677569-1FB1-4108-8535-C5BDC6E1B825@microsoft.com... > Hi > > I am putting together a pie chart, where values ...

Updating Links Option
When I get the message "This workbook contains links to other data sources" I can't imagine what "other data" they are referring to. How can I find out the source of this "other data" Thanks in advance Dave When I can't find links, I'll use Bill Manville's FindLink program: http://www.oaltd.co.uk/MVP/Default.htm It does a much better job searching for them than I can do. Dave wrote: > > When I get the message "This workbook contains links to other data sources" > I can't imagine what "other data" they are...

'Email via Mail Merge' option missing -again, please, help
No 'Mail Merge' options (email, Letter) in the Create Quick Campaign Wizard are there. I am using the Outlook client, the option 'Enable Direct E-mail via Mail Merge' is selected in System settings, approptiate roles are assigned. Outlook and web client use differenet URL, they are not running at the same time (just Outlook is running). I deleted all cookies and closed all Explorer windows - nothing helps :-(( Is your Outlook and Word the same release? ie. You have both Outlook 2003 and Word 2003? "zen" wrote: > No 'Mail Merge' options (email, L...

Org Chart Function -- Static or Dynamic?
This is a multi-part message in MIME format. ------=_NextPart_000_00C6_01C6C517.67BB36C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, It seems to me that if I create an Org Chart using the wizard in the = system and get the data from a database, then the created chart is = static in nature with no way to automatically update the structure as = items in the database change. Is this correct? If not, how do I get it to do a refresh? If so, is there anyway to create a dynamics Org Chart that can be = refreshed as the data in the un...

Pass multiple selected values from list box to table
How do I pass multiple selected values from a list box to a table? I've found code to use the values as criteria in a query but would now like to store the values in a table (at least temporarily) thanks in advance. jack Pass selected values from a list box to a table? I don't really think you want to do this. Can you describe more about what you are trying to accomplish? You just store raw data in a table. You don't store manipulated data in a table. Maybe you need a query to do what you want to do... -- Ryan--- If this information was helpful, please indi...

create new mailbox storage group on additional volume
Hi, I want to create new mailbox storage group on Exchange 2003.I added new volume. My question is What path I can put to store my new sorage group.is it has to be drive:\Program Files\Exchsrv\... or i can create any path for new database. Thank you you can place the log files for the storage wherever you like, and you can place the mailbox store database wherever you like...just specify the path... "Vlad" <Vlad@discussions.microsoft.com> wrote in message news:46659FB9-0C41-48CD-8854-73920CE67032@microsoft.com... > Hi, > I want to create new mailbox storage group ...

Flexibility in Line Item options
Hello, I am preparing a construction budget for some condos and I'd like to have a simple way to choose between different options for some of the line items (i.e. granite countertops instead of tile)... each would have its own cost implication and affect the bottom line. Any ideas? Thanks, Kalvin Mizzi Financial Analyst Equity Directions, Inc. Hi Kalvin If you make a data array with options and price as: Data array: Granite 3 Wood 4 Tile 5 You could use a validation list on the first column to make a dropdown menu and then a VLOOKUP() on the table array to change the price on the bo...

Setting a value on a main form from a subform
All, Am I correct in assuming the way to set the value of a control on the main form from a subform is: Me.Parent.ControlName.Value = "XXX" Obviously it isn't because I continue to receive errors when I try to access the control. Thanks in advance. - CES CES wrote: > All, > Am I correct in assuming the way to set the value of a control on the > main form from a subform is: > > Me.Parent.ControlName.Value = "XXX" > > Obviously it isn't because I continue to receive errors when I try to > access the control. > > Thanks in advance...

Formula to determine row of hi value filtered column
Hi all Trying to see if its possible for a formula to return the row # of the highest or lowest visible value in an autofiltered range. Thanks Richard -- rgarber50 ------------------------------------------------------------------------ rgarber50's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=11350 View this thread: http://www.excelforum.com/showthread.php?threadid=401821 ...

How to pass an object from C++
Hello! We have a C# asp.net web application that is using a COM dll We use the tlbimp to be able to use the COM dll from C# asp.net web application The method InitRules shown below is located in the COM dll. It can be seen below the text Original. Method InitRules below is called from C# but we want to pass an object of type Handle_DS in addition to all the other parameters. You can see the modified InitRules below marked Modified Note the object of type Handle_DS is a C++ object that is created from C# asp.net application and pass into the InitRules I have also copied the whole idl fil...

Help with Date Function
I have tried, and I can't figure out if this is possible. I'm trying to have dates autofill into a row of columns (C5 to V5 to be specific). I don't want week-end days to be a part of the autofill, and I can't figure out the formula. Any suggestions? Hi, Enter the first date in C5 which must be a weekday then put the formula below in D5 and drag right =C5+CHOOSE(WEEKDAY(C5),0,1,1,1,1,3) -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the questio...

Can't Install News Group Reader in Outlook 2003?
I follow the instructions for adding the news reader when you customize tool bar in Outlook 2003. When I click Go in the Commands tab there is nothing that indicates News! I have tried following the help section step by step and STILL NO News to drag to the Go section on the tool bar! Please help! I need my News Groups! Thanks, Jack Barrett http://windsurf_2.tripod.com To get the News command back, go back to the Programs tab in Control Panel | Internet Options and change the default newsreader to Outlook Express. If OE prompts you to make it your default newsreader the next time you lau...

Send options for one receipent
I'd like to set one email receipent's send options to be different from others. When I start an email for this user I can go into options and set it's priority, a different reply address, etc. I want this to be the same for the receipent all the time. Is there away I can set a default for this? Hi M.Siler, TOOLS | EMAIL ACCOUNTS | View or change existing Accounts | There you can change the default account. Is this what you asking for? -- Ich habe nichts gemacht, gestern gings noch! Bitte in den Newsgroup antworten damit jeder etwas davon hat. Bravestar@Datenschutzministerium.de...

CMFCPropertyGridCtrl
Hi All, I have an MFC application with a TreeView and a CDockablePane Properties Window. When I select a tree item - I display its properties in the properties window. That works. But I don't know how to change the tree item properties when I change the values in the properties window. My problem is in getting the values from the properties grid. I tried to override EndEditItem method like this: BOOL CMyMFCPropertyGridCtrl::EndEditItem(BOOL bUpdateData) { CMFCPropertyGridProperty* currProperty = GetCurSel(); if(currProperty) { //I don't like this implementa...

groupmethod options
When designing reports (.qrp files), what can you set GroupMethod to besides groupmethodNone or groupmethodSum? Thanks, Mike FDA ...

100% Passing Guaranteed in All I.T. Exams/Certifications at 1st Attempt Hi Friends, To pass all types of I.T Exams/Certifications with mind blowing results in 1st attempt just visit http://www.itreal
100% Passing Guaranteed in All I.T. Exams/Certifications at 1st Attempt Hi Friends, To pass all types of I.T Exams/Certifications with mind blowing results in 1st attempt just visit http://www.itrealexams.com/ and get real time Q&As, Brain Dumps, Real Exams, Study material, E-Books, Video Exams and Labs for your all type of I.T Certification Exams. ...

static member variable not working with static member functions
Hello, think its a lack of knowledge, but I have problem to realize the following szenario: I have a class C. I have 2 member function F1 and F2. F1 is static F2 not. I would like to access a static private member variable V1 from F1 and F2, so in principle both are working on the same memory-physical variable. I don't get it work. What is the right way to realize this? Best Regards Something else must be at work here. Both F1 and F2 should be able to access the static member variable. "ZZT" <a@b.c> wrote in message news:c14s48$66b$1@news1.wdf.sap-ag.de... > H...

PDF option
I have acrobat reader 6.0 loaded on my machine. However, I do not get pdf as one of the options in my reports printing file type. I am on Great Plains 8.0 You need the full Adobe to write files. Just the _reader_ won't work. Of course I expect a great many to reply to this as well and tell you there are some free and other inexpensive PDF writers out there but only Adobe will work as you are expecting it here. <anonymous@discussions.microsoft.com> wrote in message news:22a101c49a91$f3dc4110$a301280a@phx.gbl... > I have acrobat reader 6.0 loaded on my machine. However, I &...

This group has cooled down
Interesting how this group has cooled down. Nothing seems resolved so the cycle just starts over again for 06. This group has cooled down. I guess they just got tired of M05 not working and not getting any help from MS. Maybe they switched to Quicken. "someone" wrote: > Interesting how this group has cooled down. Nothing seems resolved so the > cycle just starts over again for 06. > > > Flyfishing Fool wrote: > This group has cooled down. I guess they just got tired of M05 not working > and not getting any help from MS. Maybe they switched to...

IT CertificationzzzZ.....100% GUARANTEED PASS.......!!!@!!!
IT CertificationzzzZ.....100% GUARANTEED PASS.......!!!@!!! Hi guys, If you are serious about your professional career and pass IT Certification exam in first attempt then Visit http://www.FreeExamKing.com and get latest Questions And Answers Dumps for Microsoft, Oracle, Cisco, CompTIA and many more, i have used and found it very helpful. ...