I'm getting a null reference exception on the line which I have indicated with a comment. Does anyone have an idea as to why this is happening?
var form = Form.ActiveForm as Form1;
var doSave = MessageBox.Show("Would you like to save this measurement?",
"Save Measurement",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
if (doSave == DialogResult.Yes) // User wants to save the current measurement.
{
curName = ShowDialog("Measurement Name", "Save Measurement");
// ERROR HERE ****
int ret = form.databaseClass.GetFirstSoundReadyTestOccurrence(form.testNumber.Text);