I get the error “query must have atleast one destination field” when i click a button in the form.
On click of button VB Code:
Dim stDocName As String, valore As Integer
stDocName = "Solleciti_Odl_Rilasciati_per_form_new_weekly_005_Del_dup_records"
DoCmd.OutputTo acOutputQuery, stDocName, acFormatXLS
valore = MsgBox("Estrazione Dati Completata!", vbInformation)
on clicking the button, I get a dialog box for document “Solleciti_Odl_Rilasciati_per_form_new_weekly_005_Del_dup_records”
to be saved or opened. after giving ok, the above error comes.
Please give me idea why we get this error.
DoCmd.OutputTois the object to export.Are you sure that there is actually a query named
Solleciti_Odl_Rilasciati_per_form_new_weekly_005_Del_dup_recordsin your Access database?SELECTquery)?I just found out that I get exactly the same error as you (“query must have at least one destination field”) when I try to export a query that’s completely empty.