HotRod40
New member
Hi,
I am using a 'Sub Main' procedure on a module which is my startup module. This module reads a table and then populates a combo box on the main form. Whilst this is happening a splash screen is displayed to inform the user of loading. I can connect to my database OK and read records, but when I come to populate the combo box on my main form I get an error. I have created a new variable for my form but I dont see where the problem is. The loop I use is shown below. The loop is OK but the 'cbxAccount' object is not recognised. All works OK if I do this on the main form itself. Any help would be grateful. Thanks
The Error I receive is:
"Public member 'cbxAccount' on type 'MainForm' not found."
My Code is:
//Form variable (Global)
Public frmMain = New MainForm()
//other code....
Do
frmMain.cbxAccount.Items.Add(oSalesRecord.Fields.Item("account_ref").Value)
Loop Until Not oSalesRecord.MoveNext()