Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

layout for printing in continuous form 1

Status
Not open for further replies.

heroddaji

Programmer
Aug 22, 2008
10
NL
Hello, Can anyone help me with this case?
I have to display the working hours of workers in a form ,so I use continuous form to display those values. the worker have 2 types of working hours, first is 100% hours, 2nd is 150% hours. If that guy work only 100%hours, then only show that hours. if he work also with 150%, show 2 type of hours, and finally , if he work only 150%hours, show only 150% hours. Here is an example

1st example:
name percent hours
-------- ---------- ---------
a 100 8
-----------------------------------
b 100 7
-----------------------------------
c 100 9
150 2
-----------------------------------
d 150 4
------------------------------------
my method is I use 2 text box for 100% and 150%, if that worker dont have any 150% hours,i will hide that textbox, so it take me 2 lines to keep 2 textbox per worker, and make the form look not nice.( for example, if all the worker
have only 100%hours, the 150%hours is still there and take a lot of line). I want to do something like if the worker dont have that kind of hours, the line must be not there

2nd example (the display at my form right now )
name percent hours
-------- ---------- ---------
a 100 8
//I have an empty line here for 150%, it need to be removed
-------------------------------------
b 100 7
//I have an empty line here for 150%, it need to be removed
-----------------------------------
c 100 9
150 2
-----------------------------------
//I have an empty line here for 100%, it need to be removed
d 150 4
-------------------------------------

if anyone can help me with this, i really appreciate ...
if my question is not clear, just feel free to ask or email to me.

look at the picture to understand more

Bad version :

good version ( what i try to do)

Thanks.
 
Why not use a report based on a query that does not include the empty lines?
 
SOrry, I'm not so good with access
I'm not understand your meaning
can you tell me more about your idea?
 
Please post a small number of lines from your table showing the working hours, please also post the name of the table. It will make it easier to explain.
 
OK, I will make it more clear for you
First off, here is the example file describe my case

well, in the pictures below, 1st pictures is the original
form which show all hours by worker

picture 1 :
and in the 2nd picture is my enhancement with hide the line that have the hours with value 0

picture 2:
But it look ugly and take space, picture 3 is what i want to be display ( help me to make the form like this )

picture 3:
 
From what you supplied, I imagine you want a query like this:

Code:
strSQL = "Select 'h100' as type, worker, hours, id from hours100 " _
& "union Select 'h150' as type, worker, hours, id from hours150 " _
& "order by worker, type"

However, this will not be updateable, so it all depends on what you want to do.

You would find it much easier to get what you wanted if your database was normalized ( A normalized table might look something like the union query I posted above.

As an aside, the data you supplied was difficult to work with as I do not own the Access versions that were used. I just happened to have time at the moment, but that might not be the case for other people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top