I’m trying to store an form object into a variable, but it not succeed:
This code doesn’t work:
Dim invoice_form As billing_new_invoice
'Get last remote Row
Dim last_row As Integer = CType(main.ActiveMdiChild, invoice_form).invoiceitems_new_invoice.Rows.Count - 1
Dim count_row As Integer = CType(main.ActiveMdiChild, invoice_form).invoiceitems_new_invoice.Rows.Count()
This code works:
Dim invoice_form As billing_new_invoice
'Get last remote Row
Dim last_row As Integer = CType(main.ActiveMdiChild, billing_new_invoice).invoiceitems_new_invoice.Rows.Count - 1
Dim count_row As Integer = CType(main.ActiveMdiChild, billing_new_invoice).invoiceitems_new_invoice.Rows.Count()

I need to store the form instance in the variable (invoice_form), that could be used in multiple lines of code, but it says (Type ‘invoice_form’ is not defined.)
Anyone have idea to solve this ?
Not very clear what the issue is. I think you are looking for something like this:
The problem with the code that isn’t working is that it is trying to cast it into a variable, not a type.
invoice_formis a variable,billing_new_invoiceis a type.