using radio buttons

  • Thread starter Manoj Jiwatramani via AccessMonster.com
  • Start date
M

Manoj Jiwatramani via AccessMonster.com

i have a table with 3 date columns

Request Date
Complete Date
Finish Date

so i want to create something like
3 radio buttons
1. Request Date 2. Complete Date 3. Finish Date

From: <Date Combo Box>
To: <Date Combo Box>

on the selection of a radio button, the date values will go to that
particular column and run the query.

i need to code for the radio buttons and i dont know how to do it...

please explain from scratch or provide a link.

thank you.
 
M

Mike Painter

Manoj said:
i have a table with 3 date columns

Request Date
Complete Date
Finish Date

so i want to create something like
3 radio buttons
1. Request Date 2. Complete Date 3. Finish Date

From: <Date Combo Box>
To: <Date Combo Box>

on the selection of a radio button, the date values will go to that
particular column and run the query.

Radio buttons are so named becasue only one can be selected at a time like
car radio buttons.

I assume you want to pick one of the fields and search on that one?

Help has a good bit of information and this
http://en.allexperts.com/q/Using-MS-Access-1440/write-codes-radio-buttons.htm
is just the first but it shows essentially what you need and mentions teh
importance of an option group.

Your case statement would be something like.
Select Case Me!optdates
Case 1
QryToRun = qryrequestRange ' or run a report
Case 2
QryToRun = qryCompleteRange
Case 3
QryToRun = qryFinishRange
End Select

Each query would have "Between [forms.yourform.yourfrombox] and
[forms.yourform.yourtobox] aas a criteria in the corresponding field on the
query

There are other ways but this requires less coding.

Your select should have an else clause which picks up if nothing was
selected and no button should have the default.
An "Open Report" button would make sure that something was selected and then
run
DoCmdrunquery QrytoRun

This is correst in essence but I've been sick so may have messed up a detail
or two.
 
M

Manoj Jiwatramani via AccessMonster.com

thanks alot for posting a reply. i'll soon try out the what you've mentioned
over here and post if i have any doubts.

thanks once again.

take care.
 
M

Manoj Jiwatramani via AccessMonster.com

hey Mike,
i have a few questions.

1. what does "Me!opdates" mean ?
2. do have to declare the string QryToRun ?
3. and how will this determine that the date being entered goes to a
particular column of the query ?

thanks.
 
M

Mike Painter

Manoj said:
hey Mike,
i have a few questions.

1. what does "Me!opdates" mean ?
That is the result of the option box.
2. do have to declare the string QryToRun ?
QrytoRun is a variable not a string and must be declared.
3. and how will this determine that the date being entered goes to a
particular column of the query ?
You will make that determination when you build the queries.
 

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