Reference to Form fields in Update (1 Viewer)

phinix

Registered User.
Local time
Today, 03:22
Joined
Jun 17, 2010
Messages
130
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:

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...
After that, you can slowly add the rest of the fields one at a time. For example:
Code:
If Forms!FormName.Field6 & "" <>"" Then
    strSQL = strSQL & "," & add field six here...
    strSQL2 = strSQL2 & "," & add field six here...
End If
Then, at the end, you can combine both sections.


strSQL = strSQL & strSQL2


Hope it helps...



Aaaah, thanks, I'll practice this.
 

Users who are viewing this thread

Top Bottom