For example, I might break the whole SQL into two strings:
strSQL and strSQL2
Then, with a minimum of five fields, I might start with:
After that, you can slowly add the rest of the fields one at a time. For example:Code:strSQL = "SELECT INTO [" & table1 & "] (" & all the way to the first five fields only... strSQL2 = ") SELECT Nz([" & table2 & "].[" & all the way to the first five fields only...
Then, at the end, you can combine both sections.Code:If Forms!FormName.Field6 & "" <>"" Then strSQL = strSQL & "," & add field six here... strSQL2 = strSQL2 & "," & add field six here... End If
strSQL = strSQL & strSQL2
Hope it helps...
Aaaah, thanks, I'll practice this.