dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2017
    Posts
    2

    Using Select Case to decide to choose from three differnt label formats

    I originally used nested if then but was told to use Select Case.I am attaching my code. After executing this line, the next three lines are to save the varible data to a text file depending on with being "WATER", WATER WITH SALTS" or ELSE. it wrote variables specific to which one was indetified. I added the third save variable data statement specific to "WATER WITH SALTS". i'm novice at this and I can not figure out or see what tell it to write the related text file. "WATER" AND "ELSE" WORKS but "WATER WITH SALTS" does not write the file, I can send more of the program if needed. I've been on this for two days and about bald!
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,264

    Re: Using Select Case to decide to choose from three differnt label formats

    I am hazarding a guess here, but if the two other CASE condition work, I can see from the code no reason why "Water With Salts" will not work. There may be an outside factor here. Are you sure you are getting the exact phrase "WATER WITH SALTS"?

  3. #3
    Join Date
    Dec 2017
    Posts
    2

    Re: Using Select Case to decide to choose from three differnt label formats

    Thanks for a reply. It picks the correct choice because I can pull it up in my program and print a correctly filled out test print. However, the next 2 statements after the code I sent you are "Save Variable Data" statements that write the ariable date to continue printing labels triggered form an outside source. Water with salts never writes the file and I can not find where it tells any of the three to but the other two write the file

  4. #4
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,265

    Re: Using Select Case to decide to choose from three differnt label formats

    I do not see any code there that would write to a file under any condition so whatever issue you have must be elsewhere.
    Always use [code][/code] tags when posting code.

  5. #5
    Join Date
    Jul 2005
    Posts
    1,083

    Re: Using Select Case to decide to choose from three differnt label formats

    I would change the line :
    Select Case ChosenType
    To
    Select Case UCase(ChosenType)
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)


×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.