Link to home
Start Free TrialLog in
Avatar of jleval
jleval

asked on

Send A variable from another program(C#) to my database

The database we are using is a part a different program that was initialy created using C#. Within our C# program is a method that allows the user to click a button that opens access, and allows the user to go to a particular form. Here is the method we are using

   public void OpenCutterSpecsForm(string partNo)
        {
            if (accessOpen)
            {
                try
                {
                    oAccess.DoCmd.OpenForm(
                       "frmCutterSpecs", //FormName
                       Access.AcFormView.acNormal, //View
                       Type.Missing, Type.Missing,  //FilterName and Wherecondition
                       Access.AcFormOpenDataMode.acFormPropertySettings,
                       Access.AcWindowMode.acDialog,
                       partNo);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error accessing Access Form: " + ex.Message);
                }
            }
        }

Open in new window


We understand that the following allows the user to go to a specific record:
  Type.Missing, Type.Missing,  //FilterName and Wherecondition

Open in new window


Within the application, when the current record is selected, I believe we will be able to pass the part number to the Where  Condition.

Our problem is that our original access database has a main form and a button that sends you back to the main form once you are finished with the current form you are using.

What we are trying to do is pass a  bool to the form so that when the C# program accesses it, certain attributes within the form are changed. Instead of having the button return to main show, we want another button to take its place, i.e, Close Form. There are some other things we would like to do as well.

How could we pass a variable to the form so that we can condition the form to behave accordingly. Your help would be grately appreciated
ASKER CERTIFIED SOLUTION
Avatar of Helen Feddema
Helen Feddema
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jleval
jleval

ASKER

I think i have a way to figure this out. What I will do is place a variable bool within the main form and pass it over to each form. That way whenever the other program opens the form, It will be as it is needed for that program. Thanks anyway though
Avatar of jleval

ASKER

wasn't much of an explination