Results 1 to 8 of 8

Thread: Open a form from Form1 in "add record mode"

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2016
    Posts
    97

    Open a form from Form1 in "add record mode"

    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
    Last edited by K3JAE; May 21st, 2020 at 10:44 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width