473,320 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How do I filter data on 1 form from selected cell on another form?

I am new to VB.net but I am trying to recreate an old program in .net and learn as I go so any help will be greatly appreciated.

I have one form with a datagrid that displays a list of 'contacts' with just the minimal basic info in the datagrid.

I have another form that displays ALL the 'contacts' info.

I want to double-click on any cell in the datagrid and have the other form load and show ONLY the data for that selected contact on the datagrid form.

I have no idea where to start but I have at least already figured out how to show only a select set of contacts by setting a filter on the contactstableadapter to "statusid = 4" (An agent).

Can someone please help me?
May 16 '10 #1
2 1803
@timr30017
Update:

Ok I figured out the hard part and here is my code:
Form1.ContactsBindingSource.Filter = "contactid = " & Me.ContactsDataGridView.CurrentCell.Value
Form1.Show()

But it ONLY works if I click on the ContactID field. Dbl-clicking any other field causes the wrong value to be sent. How can I force it to send the contactID value regardless of which actual cell I dbl-click on that row?
May 16 '10 #2
Aimee Bailey
197 Expert 100+
I've attached a small project example of filtering the datagridview, through a child window, hope it helps :)
Attached Files
File Type: zip DataFilteringExample.zip (129.7 KB, 79 views)
Jun 16 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Matt | last post by:
Can form.submit() submit another form? In the following example, in page1.asp, it is fine to submit the current form: form1.submit(), and and I could see the value "Joe" in page2.asp. However, if I...
8
by: Mike Caputo | last post by:
In VB.NET, need to be able to access certain properties on my main form from other forms. These are properties that may be changed by the user, so I have to be able to get to them throughout the...
3
by: Young J. Putt | last post by:
I have a vb.net datagrid bound to a dataview on a windows form. I want to use the datagrid to display and filter a list of items, but since the data is complex, I don't want the user to edit the...
4
by: amber | last post by:
Hello I'm trying to open a form from within another form I do this several times, and it works okay, but it won't work for this specific form There are 4 forms that show in the Solutions list, but...
3
by: JAPSTER | last post by:
An application has a startup form (Form1). A second form (frm2), created from within Form1. Each form has a textbox. To access the text in TextBox1 in frm2 from Form1, you use: ...
1
by: Paez | last post by:
Hi there. How can I modify a form control property from another form. Let's say, I have a frmMain that has a ToolStripMenuItem with the current user info. Then, I open another form...
7
by: mtrcct | last post by:
Hi, I have been playing around with various forms and have asked some previous questions on this topic, but thought it best to start a new thread since my forms structes have changed if anyone can...
1
by: mrichard | last post by:
I have a form where each record has a unique id. I have created other forms from tables and now I would like to add cmd buttons on the main form for each other form. Except I would like each form...
1
by: gourab | last post by:
How to write a code to hide a form and show another form?
3
by: agarwalsunitadhn | last post by:
hello i am working in C#.net. I want to know how to close one form and show another one. I had done the following code this.Hide(); MainForm frm = new...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.