I have form (Researchfm) that has canned queries that run on button click and it works just fine. But I tried adding a second form to which I can move the existing queries. In the working form there is a listbox (QryRestlylb) the displays the queries. I resize the listboox to fit query result with code that lookes like this:
This code works on this form whose record source is Mastertbl3
But when I try to build the second form that code fails with a compile err on the RowSourceType and the Rowsource.
The second form is is named Queriesfm, and I set it's record source to the same as the first form. I rebuilt the buttons on the new form set to run query, and copied the code from the first form to the the Queries form, and renamed the list boc to coorespond to the listbox on the second form. That code look like this:
Can't figure it out, why it works on the first form but not the second.
Me.QryResultlb.Visible = True
Me.QryResulltb.Height = 3718.994
Me.QryResulltb.Width = 15000
Me.QryResulltb.RowSourceType = "Table/Query"
Me.QryResulltb.RowSource = "QryGroupbyCompany"
Me.QryResultlb.ColumnCount = 10
Me.QryResultlb.ColumnWidths = "1.5in;0.8in;1.0in;1.5in;1.5in;.5in;1in;1.3in;1.5in"
This code works on this form whose record source is Mastertbl3
But when I try to build the second form that code fails with a compile err on the RowSourceType and the Rowsource.
The second form is is named Queriesfm, and I set it's record source to the same as the first form. I rebuilt the buttons on the new form set to run query, and copied the code from the first form to the the Queries form, and renamed the list boc to coorespond to the listbox on the second form. That code look like this:
Code:
Me.QryResulttb2.Height = 3718.994
Me.QryResulttb2.Width = 15000
Me.QryResulttb2.RowSourceType = "Table/Query"
Me.QryResulttb2.RowSource = "QryGroupbyCompany"
Me.QryResulttb2.ColumnCount = 10
Me.QryResulttb2.ColumnWidths = "1.5in;0.8in;1.0in;1.5in;1.5in;.5in;1in;1.3in;1.5in"
I Get this error:
[ATTACH type="full"]103957[/ATTACH]
In this line of code:
[CODE]Me.QryResulttb2.RowSourceType = "Table/Query"
Can't figure it out, why it works on the first form but not the second.