Using controls as params in a DataGridView

Posted on 2007-10-10
Last Modified: 2012-05-05
Using VB 2005

In a DataGridView, I want to use a control, a textbox, as a parameter in the sql query....

Can I do this? Ive done it in Visual Web Developer 2005 but can't do it in normal VB2005

If so how? And if not, how else?!

Question by:bdb12
    LVL 32

    Accepted Solution

    You could use its .Text property as a parameter in the query ... but not the control itself.  If you explain further what you're trying to do, perhaps I or someone else can offer more help.

    Author Comment

    Hi thats what Im after, but it still doesnt work

    I use the following query

    SELECT     *
    FROM         Timesheet
    WHERE     (UserID = btnHiddenID.[Text])

    At run time it throws up an error

    'No value given for one or more parameters'

    Any clues?


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    z = x + y – 1 6 48
    Problem to skip loop 6 40
    change vba from autofit to 13.5 width? 4 25
    Put text in a picture ASP.NET C# 2 26
    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now