-
passing value from database from one form to another form
Hi,
i have a database program using adodc component and used datagrid to view
all the extracted rows from one of the table from the database.
my question is, how can i select one row from the datagrid and pass all the
value of the selected row to another form which also has another adodc component,
the other form is used to update the selected row from the first form. my
problem is to keep the value of the selected row in the second form
the first form is used to display list of values (using datagrid), and
the second form is used to update the data from the selected row of the first
form.
-
Re: passing value from database from one form to another form
Say Form2 is your update form then use:
Dim lngID as long
Public Property ID(lngNewValue As Long)
lngID = lngNewValue
' Insert code to load other data to be displayed from the database.
End Property
If Form1 is the form with the grid then you can use:
Form2.ID = lngID
Form2.Show
where lngID is the id number that you get from the grid.
"skyxmen" <skyxmen@yahoo.com> wrote:
>
>Hi,
>
>i have a database program using adodc component and used datagrid to view
>all the extracted rows from one of the table from the database.
>
>my question is, how can i select one row from the datagrid and pass all
the
>value of the selected row to another form which also has another adodc component,
>the other form is used to update the selected row from the first form. my
>problem is to keep the value of the selected row in the second form
>
>the first form is used to display list of values (using datagrid), and
>the second form is used to update the data from the selected row of the
first
>form.
>
>
-
Re: passing value from database from one form to another form
G. Allen, and SkyXMen:
Minor correction to the posted code:
Public Property Let ID(lngNewValue As Long)
---
Arthur Wood
"G. Allen" <gallenspam@worldnet.att.net> wrote:
>
>Say Form2 is your update form then use:
>
>Dim lngID as long
>
>Public Property ID(lngNewValue As Long)
> lngID = lngNewValue
> ' Insert code to load other data to be displayed from the database.
>End Property
>
>If Form1 is the form with the grid then you can use:
> Form2.ID = lngID
> Form2.Show
>where lngID is the id number that you get from the grid.
>
>
>"skyxmen" <skyxmen@yahoo.com> wrote:
>>
>>Hi,
>>
>>i have a database program using adodc component and used datagrid to view
>
>
>>all the extracted rows from one of the table from the database.
>>
>>my question is, how can i select one row from the datagrid and pass all
>the
>>value of the selected row to another form which also has another adodc
component,
>>the other form is used to update the selected row from the first form.
my
>>problem is to keep the value of the selected row in the second form
>>
>>the first form is used to display list of values (using datagrid), and
>>the second form is used to update the data from the selected row of the
>first
>>form.
>>
>>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|