StephenMelb
New member
- Local time
- Tomorrow, 05:21
- Joined
- May 18, 2020
- Messages
- 4
Hello,
I have hit the too many line continuations in a vba select query. I have read you are limited to 24 lines and to get around that you can trick access by various methods that I have not been able to make work. I tried this cstrOldSQL = cstrOldSQL + "SELECT Contract.Accommodation," & _ but this fails.
I have a table called contracts and then I have a summary form based on query where user selects from drop down list the "Artist". The form then displays all contracts made for that specific Artist.
A double click on the Artist contract number then opens the contract form for that Artist. But I am unable to include all the field data for the form as I hit the limit of line continuations. Here is what it looks like ...
Private Sub Form_Load() ' Opens Contract form and populates fields for that record
Dim cstrOldSQL As String
cstrOldSQL = "SELECT Contract.Artist, " & _
"Contract.ContractNo, " & _
"Contract.fkTourID, " & _
"Contract.[Agreement Date], " & _
"Contract.[Date Sent], " & _
"Contract.[Behalf Of], " & _
"Contract.Employer, " & _
"Contract.Venue, " & _
"Contract.[Show Date1], " & _
"Contract.[Show Date2], " & _
"Contract.[Show Date3], " & _
"Contract.[Show Date4], " & _
"Contract.[Approx Show Times], " & _
"Contract.Fee, " & _
"Contract.[Ticket Price], " & _
"Contract.[Method of Payment], " & _
"Contract.Deposit, " & _
"Contract.[Deposit Paid], " & _
"Contract.Accommodation, " & _
"Contract.Airfares, " & _
"Contract.Motel, " & _
"Contract.[Agent for Venue], " & _
"Contract.[Agent Address] " & _
"FROM Contract " & _
"WHERE ((Contract.Artist) = (Forms!frmContractsArtistSummary!Artist))"
Me.RecordSource = cstrOldSQL
Me.Requery
End Sub
Any help would be greatly appreciated and THANKS FOR READING.
I have hit the too many line continuations in a vba select query. I have read you are limited to 24 lines and to get around that you can trick access by various methods that I have not been able to make work. I tried this cstrOldSQL = cstrOldSQL + "SELECT Contract.Accommodation," & _ but this fails.
I have a table called contracts and then I have a summary form based on query where user selects from drop down list the "Artist". The form then displays all contracts made for that specific Artist.
A double click on the Artist contract number then opens the contract form for that Artist. But I am unable to include all the field data for the form as I hit the limit of line continuations. Here is what it looks like ...
Private Sub Form_Load() ' Opens Contract form and populates fields for that record
Dim cstrOldSQL As String
cstrOldSQL = "SELECT Contract.Artist, " & _
"Contract.ContractNo, " & _
"Contract.fkTourID, " & _
"Contract.[Agreement Date], " & _
"Contract.[Date Sent], " & _
"Contract.[Behalf Of], " & _
"Contract.Employer, " & _
"Contract.Venue, " & _
"Contract.[Show Date1], " & _
"Contract.[Show Date2], " & _
"Contract.[Show Date3], " & _
"Contract.[Show Date4], " & _
"Contract.[Approx Show Times], " & _
"Contract.Fee, " & _
"Contract.[Ticket Price], " & _
"Contract.[Method of Payment], " & _
"Contract.Deposit, " & _
"Contract.[Deposit Paid], " & _
"Contract.Accommodation, " & _
"Contract.Airfares, " & _
"Contract.Motel, " & _
"Contract.[Agent for Venue], " & _
"Contract.[Agent Address] " & _
"FROM Contract " & _
"WHERE ((Contract.Artist) = (Forms!frmContractsArtistSummary!Artist))"
Me.RecordSource = cstrOldSQL
Me.Requery
End Sub
Any help would be greatly appreciated and THANKS FOR READING.