Radio buttons

G

Guest

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

Guest

Hi Nick

Open the form in design view andon the form's properties box select the data
column. You need to set the from's "record source". There is a drop down on
this row with a list of available "sources". You should be able to select
your query from this list.

Hope this helps
 
A

Allen Browne

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
 
G

Guest

Allen Browne, I am totally impressed by your willingness to help. Just to
look at the various threads is time consuming. Also thank you for your
website with all those tips.
CurtainMary

Allen Browne said:
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.

Reply to group, rather than allenbrowne at mvps dot org.

Nick said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top