Solved

Access a dataset on a form from a module

Posted on 2014-04-18
1
199 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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 …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

829 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