I need help with some code in Visual Web Developer

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
easyeman
Forum Newbie
Posts: 6
Joined: Mon Nov 15, 2004 12:52 pm

I need help with some code in Visual Web Developer

Post by easyeman »

Not sure if anyone here is good at using Visual Web Developer or not, but I'm having a problem and can't seem to get this fixed. - and I believe the code is VBScript type code if that helps.

I am doing web programming on a web site, and basically what I am doing is having a file so you can select sizes from a drop down menu and the code will cause the selected choice to bring up the correct size in the database system we have.

I can clarify more if I need to, but basically I have these fire adapters I'm putting on the web, and I can't get the code to work right (I use the same thing for a couple items, and one works and one doesn't, so not sure what's going on).

Anyway, it's set up like this: you choose the two adapter sizes, such as "1.0FNST" and "1.5FNST", and the part number after you chose would appear like this: "35R10FNST15FNST", so it'll have the starting number, and then add the two choices you select from a drop-down menu.

That's what it should do, however, when I put in the code, it keeps adding a letter into the second part so it will not work...so it ends up being "35R10FNST15FFNST" < adds an extra F in there for some reason. I cannot figure out how to remove it.

That's where I need someone's help. I'd like anyone to look it over and maybe figure out what's going on or if you see the error in the code. It's driving me crazy and I've updated it a few times and still get nothing and it has the same problem.

I appreciate any help and will give more info as to what I'm trying to do if people need it. Here is the code:

Code: Select all

Case "35RXX"
                    Select Case Left(Option1, 3)
                        Case ".75"
                            Select Case Left(Option2, 3)
                                Case ".75", "1.0", "1.5", "2.0", "2.5"
                                    Option1 = Option1.Replace(".", "")
                                    Option2 = Option2.Replace(".", "")
                                    NewDetails.NewProductID = "35R" & Option1 & Option2
                                Case Else
                                    NewDetails.NewProductID = "NOT AVAILABLE"
                            End Select
                        Case "1.0"
                            Select Case Left(Option2, 3)
                                Case ".75", "1.0", "1.5", "2.0", "2.5"
                                    Option1 = Option1.Replace(".", "")
                                    Option2 = Option2.Replace(".", "")
                                    NewDetails.NewProductID = "35R" & Option1 & Option2
                                Case Else
                                    NewDetails.NewProductID = "NOT AVAILABLE"
                            End Select
                        Case "1.5"
                            Select Case Left(Option2, 3)
                                Case ".75", "1.0", "1.5", "2.0", "2.5", "3.0"
                                    Option1 = Option1.Replace(".", "")
                                    Option2 = Option2.Replace(".", "")
                                    NewDetails.NewProductID = "35R" & Option1 & Option2
                                Case Else
                                    NewDetails.NewProductID = "NOT AVAILABLE"
                            End Select
                        Case "2.0"
                            Select Case Left(Option2, 3)
                                Case ".75", "1.0", "1.5", "2.0", "2.5", "3.0"
                                    Option1 = Option1.Replace(".", "")
                                    Option2 = Option2.Replace(".", "")
                                    NewDetails.NewProductID = "35R" & Option1 & Option2
                                Case Else
                                    NewDetails.NewProductID = "NOT AVAILABLE"
                            End Select
                        Case "2.5"
                            Option1 = Option1.Replace(".", "")
                            Option2 = Option2.Replace(".", "")
                            NewDetails.NewProductID = "35R" & Option1 & Option2
                        Case "3.0"
                            Select Case Left(Option2, 3)
                                Case ".75", "1.0"
                                    NewDetails.NewProductID = "NOT AVAILABLE"
                                Case Else
                                    Option1 = Option1.Replace(".", "")
                                    Option2 = Option2.Replace(".", "")
                                    NewDetails.NewProductID = "35R" & Option1 & Option2
                            End Select
                        Case "3.5"
                            Select Case Left(Option2, 3)
                                Case ".75", "1.0", "1.5", "2.0"
                                    NewDetails.NewProductID = "NOT AVAILABLE"
                                Case Else
                                    Option1 = Option1.Replace(".", "")
                                    Option2 = Option2.Replace(".", "")
                                    NewDetails.NewProductID = "35R" & Option1 & Option2
                            End Select
                        Case "4.0"
                            Select Case Left(Option2, 3)
                                Case ".75", "1.0", "1.5", "2.0"
                                    NewDetails.NewProductID = "NOT AVAILABLE"
                                Case Else
                                    Option1 = Option1.Replace(".", "")
                                    Option2 = Option2.Replace(".", "")
                                    NewDetails.NewProductID = "35R" & Option1 & Option2
                            End Select
                        Case "4.5"
                            Select Case Left(Option2, 3)
                                Case ".75", "1.0", "1.5", "2.0"
                                    NewDetails.NewProductID = "NOT AVAILABLE"
                                Case Else
                                    Option1 = Option1.Replace(".", "")
                                    Option2 = Option2.Replace(".", "")
                                    NewDetails.NewProductID = "35R" & Option1 & Option2
                            End Select
                        Case "5.0"
                            Select Case Left(Option2, 3)
                                Case ".75", "1.0", "1.5", "2.0"
                                    NewDetails.NewProductID = "NOT AVAILABLE"
                                Case Else
                                    Option1 = Option1.Replace(".", "")
                                    Option2 = Option2.Replace(".", "")
                                    NewDetails.NewProductID = "35R" & Option1 & Option2
                            End Select
                        Case "6.0"
                            Select Case Left(Option2, 3)
                                Case ".75", "1.0", "1.5", "2.0"
                                    NewDetails.NewProductID = "NOT AVAILABLE"
                                Case Else
                                    Option1 = Option1.Replace(".", "")
                                    Option2 = Option2.Replace(".", "")
                                    NewDetails.NewProductID = "35R" & Option1 & Option2
                            End Select
                    End Select
easyeman
Forum Newbie
Posts: 6
Joined: Mon Nov 15, 2004 12:52 pm

Post by easyeman »

I realized I didn't put exactly what the code is...It is Visual Basic.net code, if that helps any.

Anyone have any clue as to what I should do...I'm studying up on it now to see what I can do. The main problem with the code as I said is that it adds an F when selecting a size for some reason, but this same code works for other part numbers. Not sure why it is doing it for this certain number. Any help would be appreciated.
Post Reply