how to print report by check condition in textbox in form?

G

Guest

Any one can help me pls.
here I have one more solution.

I create a form with 3 checkboxes and 3 text boxes and one command button
like this :
check1 , check2 , check3
text1 , text2 , text3
cmdPrint

In Form1 :

private sub check1_click()
text1 = check1 * (-1) 'if the checkbox is checked the text box will
show 1
end sub

private sub check2_click()
text2 = check2 * (-2) 'if the checkbox is checked the text box will
show 2
end sub

private sub_check3_click()
text3 = check3 * (-3)
end sub


Can I use the text box Item to filter my data (I have one report upon with a
query) when I preview It will show only the textbox item ,like this

if checkbox1 and checkbox3 are selected then text1 = 1 and text3 = 3
the data will show only part1 and part3

here are the sample database :
no. name part
1 patrick 2
2 sofitel 3
3 ben 2
4 kim 1
 
G

Guest

Hi Sumeth,

I do not recommend such an approach. Even if it could be made to work, using
dedicated check and text boxes would be analogous to hardcoding everything in
VBA code. What happens when you all of a sudden need to deal with parts 4, 5,
6, 7... With the design you suggested, you would need to add a matched set of
controls for each part number.

Try the following example that uses a multi-select list box:

Use Multi-Select List boxes as query parameters
http://www.mvps.org/access/forms/frm0007.htm


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
G

Guest

Hi Tom
Thanks for your advisation. Actually, I've just have only six division and
I use number stand for each division 1,2,3,4,5 and 6.
That's the reason I decide a form by using check box.
how can I use the chosen value in each check box in a form to be a
condition when I print preview a report.
Suppose when I choose 1 and 3. That means the report will show only
records that have division as 1 or 3.
 

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