If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Select Record

I am trying to write code enabling the user to select a record within the
datagrid and then write another query based on what the user selects. I
am not sure where to start with allowing the user to select a record. Can
anyone help? Thanks

Re: Select Record

Look, let me see if I undertand you,

Example:
1. You populate a grid with varios records with your customers.
2. The user click's on the row with the customer he wants.
3. You create another query with the value
DataGrid.Columns(0).Value
4. You populate another Grid.

I hope i can help you.
Leopoldo

"woody" <wood060898@aol.com> wrote:
>
>I am trying to write code enabling the user to select a record within the
>datagrid and then write another query based on what the user selects. I
>am not sure where to start with allowing the user to select a record. Can
>anyone help? Thanks

I show the infor from the first Query in dgCarolynWood. I am then trying
to take the customer number from a record selected by the user and load a
differant dg showing the invoices fo that customer.

"Leopoldo" <poloart@hotmail.com> wrote:
>
>Look, let me see if I undertand you,
>
>Example:
>1. You populate a grid with varios records with your customers.
>2. The user click's on the row with the customer he wants.
>3. You create another query with the value
> DataGrid.Columns(0).Value
>4. You populate another Grid.
>
>I hope i can help you.
>Leopoldo
>
>
>"woody" <wood060898@aol.com> wrote:
>>
>>I am trying to write code enabling the user to select a record within the
>>datagrid and then write another query based on what the user selects.
I
>>am not sure where to start with allowing the user to select a record.
Can
>>anyone help? Thanks
>

Re: Select Record

The "cmdSubmit_Click" creates a recordset with some customers, and you want
the user to select a record from this recordset?,

can you epxlain to me the steps you are following?

Leopoldo

"Woody" <wood060898@aol.com> wrote:
>
>I am still unable to get this to work this is the code I have:
>
>Private Sub cmdSubmit_Click()
> Customer = txtQuery.Text
> s1 = "'"
> s2 = "%"
> Custquery = s1 & Customer & s2 & s1
> On Error Resume Next
> adCarolynWood.RecordSource = "SELECT CoNum,CustNum, CustName, City,
St
>FROM CUSTOMER Where CustName Like " & Custquery
> Call adCarolynWood.Refresh
>
>End Sub
>
>
>Private Sub dgCarolynWood_DblClick()
>Call frmFindInvoices.Show
>End Sub
>
>
>I show the infor from the first Query in dgCarolynWood. I am then trying
>to take the customer number from a record selected by the user and load
a
>differant dg showing the invoices fo that customer.
>
>"Leopoldo" <poloart@hotmail.com> wrote:
>>
>>Look, let me see if I undertand you,
>>
>>Example:
>>1. You populate a grid with varios records with your customers.
>>2. The user click's on the row with the customer he wants.
>>3. You create another query with the value
>> DataGrid.Columns(0).Value
>>4. You populate another Grid.
>>
>>I hope i can help you.
>>Leopoldo
>>
>>
>>"woody" <wood060898@aol.com> wrote:
>>>
>>>I am trying to write code enabling the user to select a record within
the
>>>datagrid and then write another query based on what the user selects.
>I
>>>am not sure where to start with allowing the user to select a record.
>Can
>>>anyone help? Thanks
>>
>

Re: Select Record

I am not explaining well. I crated a for with a text obx for a use to entered
part of a customer name. I am using a command buttone submitt to take the
partial entry of the customer name and run the query to show the a list of
customers in a datagrid

EX User enters Woo
the grid may show 3 Records along with their # and Address

Wood, Carolyn 104
Woods, James 105
Worner, Mike 106

I then want the user to be able to Double Click on James, Woods have my second
form Laod that will query another database based on the # 105. The part
that I am getting stuck on is how to get the 105 from my datagrid. Thanks

"Leopoldo" <poloart@hotmail.com> wrote:
>
>I don't understand you very well,
>
>The "cmdSubmit_Click" creates a recordset with some customers, and you want
>the user to select a record from this recordset?,
>
>can you epxlain to me the steps you are following?
>
>Leopoldo
>
>
>
>"Woody" <wood060898@aol.com> wrote:
>>
>>I am still unable to get this to work this is the code I have:
>>
>>Private Sub cmdSubmit_Click()
>> Customer = txtQuery.Text
>> s1 = "'"
>> s2 = "%"
>> Custquery = s1 & Customer & s2 & s1
>> On Error Resume Next
>> adCarolynWood.RecordSource = "SELECT CoNum,CustNum, CustName, City,
>St
>>FROM CUSTOMER Where CustName Like " & Custquery
>> Call adCarolynWood.Refresh
>>
>>End Sub
>>
>>
>>Private Sub dgCarolynWood_DblClick()
>>Call frmFindInvoices.Show
>>End Sub
>>
>>
>>I show the infor from the first Query in dgCarolynWood. I am then trying
>>to take the customer number from a record selected by the user and load
>a
>>differant dg showing the invoices fo that customer.
>>
>>"Leopoldo" <poloart@hotmail.com> wrote:
>>>
>>>Look, let me see if I undertand you,
>>>
>>>Example:
>>>1. You populate a grid with varios records with your customers.
>>>2. The user click's on the row with the customer he wants.
>>>3. You create another query with the value
>>> DataGrid.Columns(0).Value
>>>4. You populate another Grid.
>>>
>>>I hope i can help you.
>>>Leopoldo
>>>
>>>
>>>"woody" <wood060898@aol.com> wrote:
>>>>
>>>>I am trying to write code enabling the user to select a record within
>the
>>>>datagrid and then write another query based on what the user selects.
>
>>I
>>>>am not sure where to start with allowing the user to select a record.
>
>>Can
>>>>anyone help? Thanks
>>>
>>
>

Re: Select Record

Ok, Well the value you requier is in some part of the grid matrix, so you
must access this value,

When a user clicks on a grid the Row moves to the clicked row, and the only
you need now is the col, So if the value you are looking for is in the Column
2, you should access the data with this:

DataGrid.Columns(2).Value

This will give you the value of the third column (remember the columns begin
at 0) in the currently selected row.

With this you can do what you whant, I think.
Leopoldo

"woody" <wood060898@aol.com> wrote:
>
>I am not explaining well. I crated a for with a text obx for a use to entered
>part of a customer name. I am using a command buttone submitt to take the
>partial entry of the customer name and run the query to show the a list
of
>customers in a datagrid
>
>EX User enters Woo
>the grid may show 3 Records along with their # and Address
>
>Wood, Carolyn 104
>Woods, James 105
>Worner, Mike 106
>
>I then want the user to be able to Double Click on James, Woods have my
second
>form Laod that will query another database based on the # 105. The part
>that I am getting stuck on is how to get the 105 from my datagrid. Thanks
>
>"Leopoldo" <poloart@hotmail.com> wrote:
>>
>>I don't understand you very well,
>>
>>The "cmdSubmit_Click" creates a recordset with some customers, and you
want
>>the user to select a record from this recordset?,
>>
>>can you epxlain to me the steps you are following?
>>
>>Leopoldo
>>
>>
>>
>>"Woody" <wood060898@aol.com> wrote:
>>>
>>>I am still unable to get this to work this is the code I have:
>>>
>>>Private Sub cmdSubmit_Click()
>>> Customer = txtQuery.Text
>>> s1 = "'"
>>> s2 = "%"
>>> Custquery = s1 & Customer & s2 & s1
>>> On Error Resume Next
>>> adCarolynWood.RecordSource = "SELECT CoNum,CustNum, CustName, City,
>>St
>>>FROM CUSTOMER Where CustName Like " & Custquery
>>> Call adCarolynWood.Refresh
>>>
>>>End Sub
>>>
>>>
>>>Private Sub dgCarolynWood_DblClick()
>>>Call frmFindInvoices.Show
>>>End Sub
>>>
>>>
>>>I show the infor from the first Query in dgCarolynWood. I am then trying
>>>to take the customer number from a record selected by the user and load
>>a
>>>differant dg showing the invoices fo that customer.
>>>
>>>"Leopoldo" <poloart@hotmail.com> wrote:
>>>>
>>>>Look, let me see if I undertand you,
>>>>
>>>>Example:
>>>>1. You populate a grid with varios records with your customers.
>>>>2. The user click's on the row with the customer he wants.
>>>>3. You create another query with the value
>>>> DataGrid.Columns(0).Value
>>>>4. You populate another Grid.
>>>>
>>>>I hope i can help you.
>>>>Leopoldo
>>>>
>>>>
>>>>"woody" <wood060898@aol.com> wrote:
>>>>>
>>>>>I am trying to write code enabling the user to select a record within
>>the
>>>>>datagrid and then write another query based on what the user selects.
>>
>>>I
>>>>>am not sure where to start with allowing the user to select a record.
>>
>>>Can
>>>>>anyone help? Thanks
>>>>
>>>
>>
>