I am wanting to open an existing form in 'Add Record' mode from another form. In this case from my LoadInfo form - opening FuelInfo form.
I am using the following code that is not properly working - Can someone assist me please?
My original code opens the form by using the Menu1 as the Parent form then the child form (FuelInfo) opens. All forms are child of Menu1.
The commented out area (italicized) of the code works in opening the form but not in 'addnew' status, but it only works on the initial call. Any subsequent calls gives and error.
The embolden area is the new code I tried but does not work - it gives error 'There is no row at position 0' - . I suspect I am going to have to utilize the parent call I have commented out in some manner but unsure how to do it. Any suggestions?
Code:Catch ex As Exception If (LoadFormCount < 2) Then MessageBox.Show(("Fuel Record for Load Number: " + tbPETSLoadNumber.Text + " does not exist.") & Environment.NewLine & ("Please create a record for Load Number: " + tbPETSLoadNumber.Text + " on the Fuel Form.") & Environment.NewLine + Environment.NewLine & "You will now be re-directed to the FUEL Page to create the record.", "Critical Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) My.Forms.FuelInfo.FuelTableBindingSource.AddNew() 'MenuForm.FuelData() End If LoadFormCount = 0 Return End Try




Reply With Quote
