D
Deleted member 147267
Guest
At first I thought I might have been full of baloney because it didn't err as I expected - but I didn't notice that you set On Error Resume Next right off the bat. Never do that. In a code block that attempts to do something to something that might not exist, then OK. Examples might be getting an application instance that might not be open, setting a db property that might not exist, etc. but never (well almost) as a default. Also, you are not declaring multi-line variables properly.
Dim strSQL, strSQL2, strSQL3, strSQL4 As String
Only strSQL4 is a String, the rest are variants. Not sure why you're using a mix of embedded macros as well as code for pretty much the same things.
I'm at the point where strSQL is generated but I don't see the point of all that Replace stuff beforehand. It makes no changes and none seem necessary. I get SELECT [ID], SourceID, CompanyID, Company, ContactID INTO [Data Export Temp] FROM Data right off the bat.
There are no errors now, but I have no idea what's supposed to be going on. I made a couple of different checkbox selections and looked at the tables each time but saw no variations. A lot of this code could be cleaned up/removed I think, but without knowing what the difference is supposed to be from one time to another, I hesitate to do so.
Dim strSQL, strSQL2, strSQL3, strSQL4 As String
Only strSQL4 is a String, the rest are variants. Not sure why you're using a mix of embedded macros as well as code for pretty much the same things.
I'm at the point where strSQL is generated but I don't see the point of all that Replace stuff beforehand. It makes no changes and none seem necessary. I get SELECT [ID], SourceID, CompanyID, Company, ContactID INTO [Data Export Temp] FROM Data right off the bat.
There are no errors now, but I have no idea what's supposed to be going on. I made a couple of different checkbox selections and looked at the tables each time but saw no variations. A lot of this code could be cleaned up/removed I think, but without knowing what the difference is supposed to be from one time to another, I hesitate to do so.
Last edited by a moderator: