DBGrid - loading subform? 
Author Message
 DBGrid - loading subform?

I have the DBGrid setup to check for a DblClick - then it calls
another form to display data.

Trouble is, I'd like to pass the recordnumber of the DBGrid cell that
was clicked, then display the appropriate data on the subform.

This subform has several textboxes that should be populated.

I'm lost on how to pass the recordnumber when the DBGrid cell is
double clicked.  Does anyone have a sample of how to do this?

Thanks!



Fri, 25 May 2001 03:00:00 GMT  
 DBGrid - loading subform?
It is not a matter of passing a recordnumber, but rather a unique field.
I use bound controls on my subform and then simply move the recordset to
the proper record.  Here is the code for the DblClick event:
    'Show Edit Customer Info form and moves to record selected
        Load frmTenEdit
        frmTenEdit.Caption = "Edit Customer Information"
        deTenant.rscomTenantInfo.Find "[TenantID] = " _
            & deTenant.rscomTenantList![TenantID]
        frmTenEdit.Show vbModal

This example uses two ADO commands from a Data Environment.  The grid is
bound to the TenantList command and the subform controls are bound to the
TenantInfo command.

Matt Ridge

Quote:

> I have the DBGrid setup to check for a DblClick - then it calls
> another form to display data.

> Trouble is, I'd like to pass the recordnumber of the DBGrid cell that
> was clicked, then display the appropriate data on the subform.

> This subform has several textboxes that should be populated.

> I'm lost on how to pass the recordnumber when the DBGrid cell is
> double clicked.  Does anyone have a sample of how to do this?

> Thanks!



Fri, 25 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. changing the sourceobject of subform when the form and subform are loaded

2. VB4 DBGrid and Mainform subform - Help

3. Insert Data in SubForms with DBGrid and Data Control

4. Changing subform load order

5. unloading/loading subforms

6. ActiveX control causing subform's load event not to fire

7. Referencing a field on a SubForm within a Subform

8. Control name of subform from code behind subform

9. Question about the SubForm Object to help reference a subform

10. navigating for keyboard users - subfrom to form - subform to subform

11. Subform refresh moves last record to top of subform

12. tabbing from subform to subform

 

 
Powered by phpBB® Forum Software