invoke the click event of btn1 in frmY from frmX

G

Guest

In frmX I select a row from a datagridview control and I can write the
contents of the cell values into text boxes in frmY.

I declared frmX and frmY as public (global - declared in a module)
throughout my app (VB2005). I added WithEvents for each declaration.

frmY contains a form level dataset object called ds. frmX also contains a
form level dataset object called ds. When I copy the cell values from the
datagridview in frmX to the textboxes in frmY I need to clear the dataset ds
in frmY.

Public WithEvents frmY As frmYyyy
Publick WithEvents frmX As frmXxx

In frmX I tried this but didn't work:

Private Sub btnx_click(...)handles...
....
frmY.ds.clear '-- ds does not show up in the dropdown
frmY.btn1....click '--click does not show up in the dropdown

how can I clear the dataset ds in frmY from frmX?

Thanks,
Rich
 
G

Guest

I added a public sub to frmY which clears the dataset DS. I can call this
sub from frmX. So it looks like the trick is to add public subs/functions to
frmY which I can call from frmX
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top