?
Solved

Access a dataset on a form from a module

Posted on 2014-04-18
1
Medium Priority
?
220 Views
Last Modified: 2014-04-18
I have a dataset on a form with some bound controls.
The transaction based update is quite complex and I would like do place it in a module to keep all of the code for the update function in the same place, and separate from the code on the form

In the form I have a dataset, and when ready to call the update from the form I can access the data in the table by doing something like:-

dim DRow as datarow = me.ds.tables("Potrn").rows(0)

Fine

Now in the module I have :-

dim DS as dataset = form1.ds

now the code:-
dim DRow as datarow = ds.tables("Potrn").rows(0)

returns an error - no data at row(0)

Even more perplexing if I say:-
Dim DRow As DataRow = form1.DS("Potrn").Rows(0)

whereas in the form:-
me.ds.tables("Potrn").rows(0)
works fine
0
Comment
Question by:grwallace
1 Comment
 

Accepted Solution

by:
grwallace earned 0 total points
ID: 40008836
It works if use the dataset.copy() method on the calling form
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Screencast - Getting to Know the Pipeline
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question