Radio Button on opening the form

  • Thread starter Frank Situmorang
  • Start date
F

Frank Situmorang

Hello:

I have know how to open the form using command button, but now I want to use
Radio Option button to open the form consists of:
1. Show all supplier invoices
2. Show only outstanding invoices
3. Show only paid invoices

I have created 3 types of Form using 3 types of query, and now I want to
open it by using radio button with the button OK and cancel to open the form.

Is there any website providing the sample of Radio button to opent the form.
I want to studdy how to write the VBA for that.

Thanks in advance.

Frank
 
D

Douglas J. Steele

You sure you want the form to open when the radio button is selected? I'd
still make them click on a button. Otherwise they may end up opening the
form incorrectly if they click on the wrong option.

If you do want it when the radio button's selected, put your code into the
frame's Click event.
 
S

Stuart McCall

Frank Situmorang said:
Hello:

I have know how to open the form using command button, but now I want to
use
Radio Option button to open the form consists of:
1. Show all supplier invoices
2. Show only outstanding invoices
3. Show only paid invoices

I have created 3 types of Form using 3 types of query, and now I want to
open it by using radio button with the button OK and cancel to open the
form.

Is there any website providing the sample of Radio button to opent the
form.
I want to studdy how to write the VBA for that.

Thanks in advance.

Frank

If you haven't already done so, enclose your radio buttons in an option
group (Insert one onto your form from the toolbox, then select all your
buttons, cut them to the clipboard, click inside the group frame and paste
them in). Name the option group (say) "FormChoice". The option group is now
said to be "hosting" your buttons, and the group's value property may be
tested in order to determine which form to open.

So, in your Ok button's click event procedure, do something like this:

Select Case Me.FormChoice
Case 1
DoCmd.OpenForm "Form1"
Case 2
DoCmd.OpenForm "Form2"
Case 3
DoCmd.OpenForm "Form3"
End Select
 

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