Thread: Radio buttons
View Single Post
  #3  
Old August 25th, 2006, 08:15 AM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default Radio buttons

Simplest solution is to use the AfterUpdate event procedure of the option
group to assign the values to the text boxes.

Example:

Private Sub Frame0_AfterUpdate()
Select Case Me.Frame0
Case Me.opt1.OptionValue
Me.[Start Date] = DateSerial(Year(Date), 1,1)
me.[End Date] = DateSerial(Year(Date), 12,31)
Case Me.opt2.OptionValue
Me.[Start Date] = DateSerial(Year(Date), _
3 *(DatePart("q", Date) - 1) + 1, 1)
Me.[End Date] = DateAdd("m", 3, Me.[Start Date]) - 1
End Select
End Sub

--
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.

"Nick" wrote in message
...
I am trying to build a form that uses radio buttons. No 1. radio button
opens two text boxs off to the right opens up for "Year" and "Quarter".
N0. 2 radio button opens 2 text box for "Start Date" and "End Date" and
No. 3 Opens up a drop down combination box.
I may have put the cart before the horse but the querys used for all
currently pop up with the request criteria. How does one attach the query
to
the form.