Solved

Access a dataset on a form from a module

Posted on 2014-04-18
1
201 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…

733 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