This question involves the list box control. The attached file contains the code. The list box control in my database (EE_1140419.mdb) is lstTimes, which is on the frmMainMenu. An image of the row source for the list box control (lstTimes) is Query1.
The form load event code for the frmMainMenu form is: Me!lstTimes.Selected(0) = True. The problem is that only the primary key field is displayed on the frmMainMenu form when the form loads (see the OnlyPrimaryKey screen shot.). How do I correct the error?
I am using with the Contacts database from the "Microsoft Access 2010 Inside Out" book as an example. I'm not going to upload the .accdb file from the book's CD because I think it is a copyright violation. The list box control (lstCName) that I am working with (using as an example) is on the Company List form (frmCompany List) in the Contacts database.
An image of the row source for the list box control (lstCName) is qlkpCompanies. The form load event code for the frmCompany List form is: Me!lstCName.Selected(0) = True.