Radio buttons not responding

Glenn Walker 251 Reputation points
2023-05-06T14:45:38.41+00:00

I have a search algorithm. The algorithm was setup to allow the capability to run specific searches through the records of a table. Instead of inputting an SQL search routine, there exists a set of parameters that can just be fill in. However, if more than one parameter is used, then either the AND or the OR radio button must be clicked. Whichever one is clicked should cause the variable MyCondition to be filled with the appropriate value. All of the selected parameters are built into a single variable called BuildQuery.

I am sure that there are much better ways to do this, but this was what my little punkin head was able to cobble together that worked... until now.

I run into a problem when I use either the AND or the OR condition.

If I click either the AND, or the OR radio button. I step through the code and I can see that whichever condition I have checked on the form is not carried over into the code and the varable MyCondition remains blank.

There are two other radio buttons and a checkbox on the form and when any of them are clicked, the value is carried over to the code.

I had assumed that I had set some property wrong, but I have been unable to find any evidence of that. Considering that pair of radio buttons work, and the AND/OR pair do not does indicate, to me, says to me that a property setting is not correct.

So my question is what are the reasons that neither of this pair of radio buttons respond as expected?


#Region "Establish Connection and execute query"
                MasterBase.MasterBaseQuery("SELECT colSystemID,colName,colType,colFilePath,colActive " &
                                           "FROM sitVendorMaster " &
                                           "WHERE " & BuildQuery &
                                           "ORDER BY colSystemID ASC")
    Public Sub AddParams() 'Search parameters and algorithm


screenshot

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,791 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Glenn Walker 251 Reputation points
    2023-05-08T17:09:33.99+00:00

    Actually, I finally found the issue and was able to resolve it. It turns out that after looking very, very closely (after about the millionth time), I noticed that there were actually two variables that were misnamed. The issue was never in the query.

    I would have posted the resolution, but I was never able to find my way back to the thread.

    I also noticed that the code blocks showing the algorithm never seemed to get loaded into the original post. This was where the misnamed variables were and was the key information.

    I really thank you for the comments, but this forum is a little difficult for me to operate.

    My project is a Visual Studio project (2022) using VB. I am using an SQL database engine for all of the tables associated with the project.

    0 comments No comments

  2. Glenn Walker 251 Reputation points
    2023-05-08T17:17:15.6266667+00:00

    Well here I go again. I just posted an answer and it disappeared. I seem to have a lot of difficulty trying to use this forum. I have been unable to even find the thread, after the original post, until I received a message that enabled me to access the thread. Additionally, the most important code block (the algorithm) was not in the original post, even though I loaded it.

    I did find the issue, after going through the code about a million times. It was misnaming of two of the variables in the algorithm causing the wrong dgvList to be called. That is actually resolved.

    Sorry about my obvious ineptitude with this forum, but I do have a lot of trouble finding, and then getting everything into the thread, that I want.

    0 comments No comments