Thursday, September 29, 2016

How to Fix Problem - Do While Loop with a Input box seems to be going into a endless loop.?

Do While Loop with a Input box seems to be going into a endless loop.

If the Input Entry is Not a "C" or a "H", or it does not equal blank or the default string then proceed.  Even though I Type "C" or "c" it keeps going into a loop.  What am I going wrong?
 Dim phonetype As String
   Do While phonetype <> "C" Or _
   phonetype <> "c" Or _
   phonetype <> "H" Or _
   phonetype <> "h" Or _
   phonetype = NullString Or _
   phonetype = "Select Letter"
    
    phonetype = InputBox(Prompt:="Which Number do you wish to provide Cell or Home ? " _
    & vbNewLine & vbNewLine & "SELECT Letter" & vbNewLine _
    & vbNewLine & "C  =  Cell Phone " & vbNewLine _
    & vbNewLine & "H  =  Home Phone" & vbNewLine, _
    Title:="ROOM TYPE", Default:="Select Letter")
    MsgBox (phonetype & " " & " This is the first MSGBOX")
    phonetype = phonetype
    MsgBox (phonetype & " " & " This is the 2nd MSGBOX")
    MsgBox ("  You MUST select a Letter  ! ")
    Loop
   
  
    Select Case phonetype
            Case "C", "c"
                'Input Cell Phone
            mycell.Select 'currently sitting at the zipcode cell
            ActiveCell.Offset(2, 0).Select
            Set mycell = ActiveCell.Offset(0, 0) 'currently sitting at the Cell Phone cell
            Selection.NumberFormat = "[<=9999999]###-####;(###) ###-####"
            mycell.Value = InputBox("what is the Guest CELL Phone? ", _
            Title:="CELL-PHONE", Default:=mycell.Value)
               
                phonetype = MsgBox(Prompt:="Does the customer want to provide Home Number ?", _
                    Buttons:=vbYesNo)
                    If phonetype = vbYes Then
                    ActiveCell.Offset(-1, 0).Select
                    Set mycell = ActiveCell.Offset(0, 0) 'currently sitting at the Home Phone cell
                    Selection.NumberFormat = "[<=9999999]###-####;(###) ###-####"
                    mycell.Value = InputBox("what is the Guest Home Phone? ", _
                    Title:="HOME-PHONE", Default:=mycell.Value)
                    'ActiveCell.Offset(1, 0).Show
                    ActiveCell.Offset(1, 0).Select
                    Set mycell = ActiveCell.Offset(0, 0) '
                    MsgBox (mycell.Value & "Not Sure where I am at")
                    Else
                    GoTo DL:
                    End If
               
            Case "H", "h"
                 'Input Home Phone
            mycell.Select 'currently sitting at the zipcode cell
            ActiveCell.Offset(1, 0).Select
            Set mycell = ActiveCell.Offset(0, 0) 'currently residing at the home phone cell
            'MsgBox (mycell.Value & "   Should be Home Number")
            Selection.NumberFormat = "[<=9999999]###-####;(###) ###-####"
            mycell.Value = InputBox("what is the Guest Home Phone? ", _
                Title:="HOME-PHONE", Default:=mycell.Value)
           
                phonetype = MsgBox(Prompt:="Does the customer want to provide Cell Number ?", _
                    Buttons:=vbYesNo)
                    If phonetype = vbYes Then
                    ActiveCell.Offset(1, 0).Select
                    Set mycell = ActiveCell.Offset(0, 0) 'currently sitting at the Cell Phone cell
                    'MsgBox (mycell.Value & "The Customer said yes to provide cell # after givng home number")
                    Selection.NumberFormat = "[<=9999999]###-####;(###) ###-####"
                    mycell.Value = InputBox("what is the Guest CELL Phone? ", _
                    Title:="CELL-PHONE", Default:=mycell.Value)
                   
                    Else
                     Set mycell = ActiveCell.Offset(1, 0) ' currently residing at the cell phone cell
                        'MsgBox (mycell.Value & "   Customer decided not to give cell number after getting home number")
                        ActiveCell.Offset(1, 0).Select
                    End If
        
    End Select

Solutions to the Problem Do While Loop with a Input box seems to be going into a endless loop.

Download Error Fixer for Free Now

Lookimg at the rest of your code, what you appear to require is
Dim phonetype As String
start:
phonetype = InputBox(Prompt:="Which Number do you wish to provide Cell or Home ? " _
                           & vbNewLine & vbNewLine & "SELECT Letter" & vbNewLine _
                           & vbNewLine & "C  =  Cell Phone " & vbNewLine _
                           & vbNewLine & "H  =  Home Phone" & vbNewLine, _
                     Title:="ROOM TYPE", Default:="Select Letter")
If phonetype = "" Then
    MsgBox "User cancelled"
    Exit Sub
End If
Do While LCase(phonetype) <> "c" And _
   LCase(phonetype) <> "h"
    MsgBox ("  You MUST select C or H! ")
    GoTo start:
Loop

wrote in message news:*** Email address is removed for privacy ***...
Hello Rick,

Even when I replaced the Or's with the And's it does not resolve the issue -- it just skips the whole thing and moves on to the next line.

Graham Mayor - Word MVP
www.gmayor.com
Posted via the Communities Bridge
http://communitybridge.codeplex.com/

Run CHKDSK

  • Go to the Start button.
  • In the Search box, type "cmd" (without quotes) and press Enter.
  • At the command prompt, type "chkdsk /r /f" (without quotes) and press Enter.
  • Reboot your computer.
An error might pop up:

"Access denied as you do not have significant privileges. You have to invoke this utility in elevated mode."

If you receive the above error message, it means you are not logged into you computer as an Administrator. If that's the case, follow these steps to run the command prompt in elevated mode:

  • Go to theStart button.
  • Go to "All Programs > Accessories" and right click on "Command Prompt".
  • Select "Run as Administrator".
  • In the Search box, type "cmd" (without quotes) and press Enter.
  • At the command prompt, type "chkdsk /r /f" (without quotes) and press Enter.
  • Reboot your computer.

Recommended Method to Fix the Problem: Do While Loop with a Input box seems to be going into a endless loop.:

How to Fix Do While Loop with a Input box seems to be going into a endless loop. with SmartPCFixer?

1. Download Error Fixer. Install it on your computer.

2. After the scan is finished, you can see the errors and problems which need to be repaired.

3. The Repair part is done, the speed of your computer will be much higher than before and the errors have been fixed. You can also use other functions in this software. Like dll downloading, windows updating and print spooler error repair.


Related: Way to Update & Download SONY SVE14A2X1EH Wireless State Device driver,How to Update & Download SONY SVS1511X9RB Graphics Driver for D2 (Intel) v.9.17 - 9.17.10.2828,Method to Download SONY VGN-CR290N Realtek High Definition Audio Driver v.5.10.0.5433,Download SONY VGN-FS710/W Utilities DLL Update v.6.4.0.06290 driver,Method to Update & Download SONY VGN-NR460E/P Intel Graphics Media Accelerator Driver v.6.14.10.4847,How to Fix Error 0x0000c1f5 SoluciĆ³n?,Error 0x80071a91 Win7 Fix Patch,Error 0x800ccc60 Windows Live Mail [Solved],Error Message 0x800ccc79 Outlook 2000 Fix,What is Error 0xc1ab0001?,[Answered] x64 saplugin dll,How to Fix Problem - Kb943729 Download?,Troubleshooting: Bccode D1 Error,Java Runtime Tech Support,Troubleshooting: ERROR NO SUCH GROUP Error,Solution to ashoutxt.dll Missing Error,Solution to cxcore096.dll Missing Error,Where can I Find dsauth.dll File,How to Fix msde.dll Not Found Error,Best Method to Fix psizewizres.dll Error
Read More: How Can I Fix - do i need to install .NET Framework 2.0 prior to .NET Framework 3.5??,Fast Solution to Problem: Do all updaters use IE to update?,How to Resolve - does WinDbg: 6.12.0002.633x86 start automatically??,Troubleshooting:display driver failed error message,Troubleshoot:Display values from a percentile range of data,Data validation question. Maintaining and updating named ranges.,Desktop Gadget Gallery on Windows 7,delete empty rows,Deleting a page and also how can I copy an exact page lay out on a new page,Date Formula for 1st Sunday of each Month (3rd to 9th)

No comments:

Post a Comment