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
Microsoft AccessSoftware

Avatar of undefined
Last Comment
jleval

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Helen Feddema

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
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
jleval

ASKER
wasn't much of an explination
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23