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

Sent nulls to a .txt file? 1

Status
Not open for further replies.

Palmyra

Programmer
Jan 5, 2007
150
US
I have a form with six text boxes that users can type label information into. The text boxes are unbound. I push that data to a .txt file that is used by a label application to print labels.

If the user only types in label1, the .txt file has blank lines for labels2, 3, 4, 5 and six which causes the label software to print some junk.

Is there a way for me to set the variables that have no data in them to null, even if they're unbound text boxes.

Thanks.

Open DestinationFolder & "SeparatorLabels.txt" For Output As #1

Print #1, Label1
Print #1, Label2
Print #1, Label3
Print #1, Label4
Print #1, Label5
Print #1, Label6

Close #1
 



Hi,

Isn't the label software wanting printable characters?

Maybe SPACES?

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Could you just set the code up not to pass the values to the file if the textboxes are blank?

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Do you mean NULL as in null timing? i.e. a period where nothing is transmitted?
 




Palmyra, as in US 422?

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 

I am with HarleyQuinn ,
How about:
Code:
Open DestinationFolder & "SeparatorLabels.txt" For Output As #1

If Len(Trim(Label1)) > 0 Then
    Print #1, Label1
End If
If Len(Trim(Label2)) > 0 Then
    Print #1, Label2
End If
...

Have fun.

---- Andy
 
This Palmyra is a town in New Jersey across the river from Philadelphia. Don't think US 422 is near here.
 




Tacony Palmyra bridge; have crossed it many times in the distant past.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top