Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I bring up a new detail record form from a datagrid selection

Status
Not open for further replies.

Cranger

Programmer
Apr 4, 2001
54
US
I have a Header/Detail form with a Class Module.

My order header information is in the top part of the form and my order detail is a datagrid at the bottom of the form. Because my detail record is large, I am only displaying key fields for identification purposes in the grid. When a user selects a record, I want to bring up a new form with all the detail information present so they can edit or add a new record.

Not being that familiar, I really need some help in figuring out the best way to do this (coding wise) and if I can reference the same class module. If anyone can point me in the write direction I would appreciate it. THanks.
 
Rephrasing my question a bit...

Once my record from the datagrid is selected, I want to bring up a form with that record for editing. Can I do it be referencing the same adoRS that is on the main header/detail(grid) form? If so, not sure how to bring up the new form referencing that exact detail record. Or, is it best just to open another rs and just read the access the detail?
 
Suggest using another adors as the original doesn't have all the info . . ?

DataGrid1.Col = x - where x is the pk on table
myvalue = DataGrid1.Text

then pass my value through to next form (properties/global vaiable) and do your query there.

Or am I missing something ?

[flowerface]






"All I ask is the chance to prove that money can't make me happy." - Spike Milligan
 
Thanks.

You aren't missing anything. Just trying to figure out what the best way would be. I do not write much code and trying learn what I can.

But my original adoRs has all the fields from the detail record. I am just restricting what is displayed in the grid.
 
then you can use the original adors . . . then you can just pass that record through to display on the detailed screen.

or does it have to be on a different screen ? . . .

you can always have two grids that one that binds to the adors and displays your limited info and the one that would display the detailed version - just use the .zorder 0 to swap between the 2 or use frames and then swop between the frames. easier than passing all the info 2 another form.

[flowerface]

"All I ask is the chance to prove that money can't make me happy." - Spike Milligan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top