Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

Pass value of option button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
singeredel - 08 Mar 2005 18:37 GMT
Can anyone tell me what is wrong with this code? I am trying to pass the
value of the option button as yes (or no) to a userform. The spin button
values pass, but not the option button value.

With Normal.ReportFormQTCTest

   optQuadisYes.Value = True
   
   .spnScheduleDateMonth.Value = 3
   .spnScheduleDateDay.Value = 8
   .spnScheduleDateYear.Value = 2005
   .cmbClinicLocation.Value = "010"
   .cmbDoctorName.Value = "Bleecker"
   .cmbClinicName.Value = "QTC"
   .Show
   
End With

Thanks!
Signature

singeredel (Julie)

Jean-Guy Marcil - 08 Mar 2005 20:32 GMT
singeredel was telling us:
singeredel nous racontait que :

> Can anyone tell me what is wrong with this code? I am trying to pass
> the value of the option button as yes (or no) to a userform. The spin
> button values pass, but not the option button value.

You forgot a "." (Period) just before optQuadis.... ?

> With Normal.ReportFormQTCTest
>
[quoted text clipped - 7 lines]
>    .cmbClinicName.Value = "QTC"
>    .Show

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

singeredel - 08 Mar 2005 20:59 GMT
Thank you! You are so right! Doh!

> singeredel was telling us:
> singeredel nous racontait que :
[quoted text clipped - 16 lines]
> >    .cmbClinicName.Value = "QTC"
> >    .Show
Martin Seelhofer - 08 Mar 2005 23:30 GMT
Hey there

> You forgot a "." (Period) just before optQuadis.... ?
>>    [...]
>>    optQuadisYes.Value = True
>>    [...]

Which reminds the careful VBA-programmer once again
to always turn on Option Explicit ;-)

Cheers,
Martin
Jonathan West - 09 Mar 2005 16:37 GMT
> Hey there
>
[quoted text clipped - 5 lines]
> Which reminds the careful VBA-programmer once again
> to always turn on Option Explicit ;-)

Agreed!

The art of defensive programming
http://www.word.mvps.org/FAQs/MacrosVBA/MaintainableCode.htm

Why variables should be declared properly
http://www.word.mvps.org/FAQs/MacrosVBA/DeclareVariables.htm

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.