checkbox help

Chimp8471

Registered User.
Local time
Today, 00:47
Joined
Mar 18, 2003
Messages
353
how can i set up my form so that if i enter a date range and tick one of the boxes it runs the relevant report, the data range thing isn't an issue, i know that bit...

but i need to know how to know that if checkbox1 is selected it will run the report for that.

check.jpg


i am aware that i will need some fairly simple code to do this (I think) but just need a little help getting started please.

My textboxes are called:

text1, text2

my checkboxes arer called

check1,check2 etc

my preview button is called:

pre_but1

and my reports are called

rpt_1, rpt_2 etc..


please help
 
Ok I am asuming from your post that you are new to this

First I wouldn't use a check box for this I would use a button.

A good place to start would be to create a macro in the on click event if you then convert the macro to VB it will show you what the code is.

This, while not ideal, will give you a good place to start.
(When I started I used it as a language dictionary)
Then do a lot of reading. Follow the paper trail through the help files looking up each command and you will soon get a feel for it. While Access help often dose not appear very helpful it actually dose tell quite a lot if you know what to look for.
You can then destroy the macro and it's conversion and write the code yourself

Pete
 
I have changed my checkboxes to an Option group now, and have successfully started to get this to work....

is there a way of having more than 20 options available, i have 23 lines of machines and i can only choose the 20 from the option group menu.
 
so instead of using the following code:

Select Case OptionGroupName
Case 1
DoCmd.OpenReport "MyReport1", acViewPreview
Case 2
DoCmd.OpenReport "MyReport2", acViewPreview
...
Case Else
MsgBox "No item selected."
End Select

how would i adapt this to suit my combo box, please

my combobox is called "Combo1"
 

Users who are viewing this thread

Back
Top Bottom