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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If a database field isnull, move everything up!

Status
Not open for further replies.

slaman

Programmer
Jun 8, 2001
47
CA
Ok, I am starting a new thread because I guess my question was too confusing. I am trying to create a printable form that fits on one page. This form is a summary of all the information in the database. Now, not all fields in the database are required, meaning they can be null. This is where the confusing part comes in. If a field in the database is NULL, I want the corresponding textbox to disappear and I want all textboxs below it to move up a certain amount so the result isnt a blank space. Is this possible? If it is, what algorithm and specific methods are required?
 
"I am trying to create a printable form that fits on one page. This form is a summary of all the information in the database."

The first sentance is a more-or-less physical contradiction to the second. A database which would "fit on one page" would be to trivial to want to print out.

Also, consider that in the general sense, moving a column of information (vertiaclly) in a report destroys the viaual relation of the column to the record of origin. Bad practice. Probably a bad interpertation of your needs on my part, but then if I read it wrong we "share" the responsability for the error/pro=blem.


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Woah, I think you incorrectly interpreted what I'm doing. A database has, lets say 25 fields. Each record in this database has 25 fields, but not all of these are Required fields - meaning they can be left as Null. Now, when I generate a summary report for each record in the database, I want to display all 25 of these fields on one FORM. This FORM has to print out all the information on one page. The way I want to do this is by ommiting any fields that have been left as Null. Lets say the database Field called [Former Names] has been left null. On this summary page I am creating, I have created a textField called [txtFormerNames] which refers to the record's [Former Name] field. If this is null, I want to make it invisible to the user. If I do this, it will leave a blank space where the text field USED to be. So my idea was to make it invisible and then move everything below it UP a little bit to cover the blank space. I want to do this for each textfield. That way, there will be no blank textfields on this summary form.
 
It is very possible, but why? It seems very labor intensive, merely to hide null values. I don't know of any easy way to code this. If anyone knows of an easy way, I am open.

Later

R
 
Slaman,

When you refer to "FORM" are you really meaning "Report"? If so you can set the "Can Shrink" property of the text box to No. I'm not sure but I think this will not work with a calculated value.

Best regards,

Henr¥
 
The reason I am trying to do this is so that it doesnt show up on the Summary. Why bother having that textBox show up as a blank space and take up room? This is a one-page summary of the record in the database displaying only relevant information in a space-efficient manner.
 
i thought I replied to this post but maybe not.

try selecting new report choose your data source and select the mailing labels wizard. It will something like the Trim function. When I have done this in the past any address field which is blank disappears and the fields below move up.

Nick
 
For a report create a text box and set CAN GROW property to YES.

The Control Source would contain something like

=IIf(IsNull([flda]),"",[flda] & Chr(13) & Chr(10)) & IIf(IsNull([fldb]),"",[fldb] & Chr(13) & Chr(10)) ...


Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top