473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

help in vbs with and/or statement

1
Hello,

i want to see if i can do an and/or statement

ex.
outputbox 1 requried (ex. ext #)
outputbox 2 optional (ex. fax #)
outputbox 3 optional (ex. cell #)


displays

t:(ext #)
f:(fax #)
c:(cell #)

i want to be able to have the C: move up a line if i do not put in a fax #, right now if i leave the fax # number blank it stil puts
t:(ext #)
f:
c:(cell #)

and i dont want the space there i want the c: to move up
here is the line that formats the answers from the output boxes


fOutput.WriteLine vbTab & "<td><div style=""margin-left: 10px;""><span style=""color: Navy; font-weight: bold;"">t:</span> " & sPhones & "<br /><span style=""color:

Navy; font-weight: bold;"">f:</span> " & aItems(FAX) & aItems(CELL) & "</div></td></tr></table>"

thx
Jul 12 '07 #1
1 1585
Hello,

i want to see if i can do an and/or statement

ex.
outputbox 1 requried (ex. ext #)
outputbox 2 optional (ex. fax #)
outputbox 3 optional (ex. cell #)


displays

t:(ext #)
f:(fax #)
c:(cell #)

i want to be able to have the C: move up a line if i do not put in a fax #, right now if i leave the fax # number blank it stil puts
t:(ext #)
f:
c:(cell #)

and i dont want the space there i want the c: to move up
here is the line that formats the answers from the output boxes


fOutput.WriteLine vbTab & "<td><div style=""margin-left: 10px;""><span style=""color: Navy; font-weight: bold;"">t:</span> " & sPhones & "<br /><span style=""color:

Navy; font-weight: bold;"">f:</span> " & aItems(FAX) & aItems(CELL) & "</div></td></tr></table>"

thx
If I am understanding you correctly you create an output string so the following should help
you could try:

Expand|Select|Wrap|Line Numbers
  1. ' <General/ Sub declaration>
  2. dim Info(2) as string  ' declare an array of the info 0) ext, 1) fax, 2) cell
  3. dim str as string = "" ' declare the result output string
  4. dim LoopVarI as integer = 0
  5. Enum ID
  6.  
  7.  
  8. ...
  9.  
  10.  
  11. ' <After infor is assigned>
  12. for LoopVarI = 0 to 2
  13.  
  14. if info(LoopVarI) <> "" then
  15.  
  16. str
  17.  
  18. end if
  19.  
  20. next
  21.  
Jul 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

46
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") ...
6
by: Mark Reed | last post by:
Hi all, I am trying to learn a little about programming (I know next to nothing so far) and have found some code which hides the toolbars. However, this bit of code is a little too effective and...
8
by: drose0927 | last post by:
Please help! I can't get my program to exit if the user hits the Escape button: When I tried exit(EXIT_SUCCESS), it wouldn't compile and gave me this error: Parse Error, expecting `'}''...
5
by: Jesee | last post by:
I am reading Jeffrey Richter's book "Applied Microsoft .NET Framework programming",i came across "Exception handing". Page 405 says "If the stack overflow occurs within the CLR itself,your...
11
by: Scott C. Reynolds | last post by:
In VB6 you could do a SELECT CASE that would evaluate each case for truth and execute those statements, such as: SELECT CASE True case x > y: dosomestuff() case x = 5: dosomestuff() case y >...
2
by: Greg Corradini | last post by:
Hello All, A few weeks ago, I wrote two scripts using mx.ODBC on an Access DB. Among other things, both scripts create new tables, perform a query and then populate the tables with data in a...
6
by: redashley40 | last post by:
This is my first attempt in SQL and PreparedStatement I have add the PreparedStatement and I'm not to sure if I'm doing it correctly. When I do a test run on Choose 1 ,or 2 I get this error. Error...
2
by: rookiejavadude | last post by:
I'm have most of my java script done but can not figure out how to add a few buttons. I need to add a delete and add buttong to my existing java program. Not sure were to add it on how. Can anyone...
0
by: RCapps | last post by:
When running the below SQL Query I keep getting the following error: Server: Msg 4924, Level 16, State 1, Line 1 ALTER TABLE DROP COLUMN failed because column 'ContractDef' does not exist in table...
2
by: kya2 | last post by:
I am not able to create following store procedure. CREATE PROCEDURE DBSAMBA.InsertDeleteBatch(OUT norows INT ) RESULT SETS 1 LANGUAGE SQL BEGIN part1 DECLARE TOTAL_LEFT INT DEFAULT 0; ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.