Pass a variable from one program to another

jleval

Registered User.
Local time
Today, 05:08
Joined
May 16, 2012
Messages
53
We have one system written in C# and our access database. At this moment we are able to pull open a form in access from our C# program. What we want to be able to do is open the form to filter to a specific record. Can we do this by passing a variable? What would you guys suggest?
 
What you can do in C#, using System.Data.OleDB (I think) is write a value to a table in your access database. Then your form, when it opens, can consume that value and respond appropriately.
Mark
 
This seems a bit late…

The requirement is a bit sketchy and I haven’t used C# at all.

Since you can already open the Form in Access then the following should apply:-

A Form in Access can receive OpenArgs as a passed variable, much the same as an argument passed to Main in C, which becomes available on or after the Form Open event.

The OpenArgs variable is a Variant data type and so can handle almost anything you care to throw at it. You should be able to pass either the numerical ID of the record or the Filter as a String.

So, it will depend on the method used to open the Access Form from C# and if you can pass an OpenArgs variable.

Chris.
 

Users who are viewing this thread

Back
Top Bottom