Dim sort_slots_sql As String
sort_slots_sql = _
"select date, part, service, slot" & _
" from ass_slots, ass_occasions" & _
" where ass_slots.occasion = ass_occasions.occasion" & _
" order by slot, service, date, part"
Set slots_rst = db.OpenRecordset(sort_slots_sql)
This gives a too few parameters error. One is expected. On another place in the code, there is an almost identical situation but there, two parameters are expected!
I can't say conclusively, but I am 99% sure the problem is that you have included a field name in that query that doesn't exist in the table. Check all the fields names and make sure they are spelled exactly like they are in the table.
Also the "Date" field is a likely suspect since it is a reserved word in Access. I'd suggest not naming a field "Date". However, if you are stuck with that name, surround it with square brackets in all your queries like so:
Dim sort_slots_sql As String
sort_slots_sql = _
"select [date], part, service, slot" & _
" from ass_slots, ass_occasions" & _
" where ass_slots.occasion = ass_occasions.occasion" & _
" order by slot, service, [date], part"
Set slots_rst = db.OpenRecordset(sort_slots_sql)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With