My Daily question. I have a form upon which is a button that is supposed run a query, where the user can input a Company Name, then the data is returned into a listbox. I probably went about this wrong. The query is prewritten and is in the queries list, and runs, but not on the form. Here is the code for the on click event in the button.
The SQL for the query is as follows
It was created in the grid)
When running with breakpoint up until the RowSource. It opens a dialogue box, and when I fill it in, it goes back to the first satament in the code
Is VBA the best way to do this, or is there an easier way?
Code:
Me.DisplayQrylb.Visible = True
Me.DisplayQrylb.Height = 3700
Me.DisplayQrylb.Width = 24000
Me.DisplayQrylb.RowSourceType = "Table/Query"
Me.DisplayQrylb.RowSource = "QryInputCoName"
Me.DisplayQrylb.ColumnCount = 12
Me.DisplayQrylb.ColumnWidths = "1.5in;.8in;1.0in;.8in;2.2in;1in;1in;1.3in;1.5in;1in;1in;1in;1in"
The SQL for the query is as follows

Code:
SELECT MasterTbl3.companyname1, MasterTbl3.callingnumber, MasterTbl3.calldate, MasterTbl3.starttime,
MasterTbl3.Duration, MasterTbl3.[1stcontact], MasterTbl3.[2ndcontact], MasterTbl3.[3rdCtctClass],
MasterTbl3.personcallbackno, MasterTbl3.recordingname
FROM MasterTbl3
WHERE (((MasterTbl3.companyname1)=[CompanyName]));
When running with breakpoint up until the RowSource. It opens a dialogue box, and when I fill it in, it goes back to the first satament in the code
Is VBA the best way to do this, or is there an easier way?