Omitting fields from a string

Jofffox

Registered User.
Local time
Today, 06:38
Joined
Feb 26, 2008
Messages
12
I currently use the following code on a button to publish a number of fields into a single textbox and then copy this text to the clipboard


Me.txtExportText = vbCrLf _
& Me![Combo55] _
& vbCrLf & Me!
[List33_Label] & ": " & Me!
[List33] _
& vbCrLf & "Time: " & Me![Time:] _
& vbCrLf & "Contact Name: " & Me![Contact Name:] _
& vbCrLf & "Contact Number: " & Me![Contact Phone] _
& vbCrLf & "Company " & Me![Company] _

The problem i am having is omitting fields that have a null value into the string for the export:
e.g:

Name: Joe BLogs
Time: 12:12
Conatact Name: Mr Jones
Contact Number:
Company: Microsoft


as a contact number has been omitted i would like to remove the field completely and was wondering if that was possible?

thanks in advance

jon
 
Sounds like an "If...Then..Else" statement is called for.
Something like...
If not isnull([Contact Name:]) then
"Contact Name: " & Me![Contact Name:]
Else
 

Users who are viewing this thread

Back
Top Bottom