M
Marlon Smith-Williams via AccessMonster.com
I am trying to produce some vb code that will query table1 in database1 and
write the results to table1 in database2. When I run the following I get a
message:
"Wrong number of arguments used with function in query expression - 3075"
using Access 2000. The code breaks at the first isnull function. Can anyone
point me in the right direction to resolving this. It would be grately
appreciated.
-----CODE------
DoCmd.RunSQL "INSERT INTO [dbo_LOCALEXTRACTION]" _
& "(datasource , datasourceref , seqrefnum , organisation , firstname ,
lastname , address1 ,address2 , address3 , address4 , town , county ,
postcode , email , telephone , mobile , fax , deceasedflag , goneawayflag ,
dataprotectionflag)" _
& "SELECT NULL as datasource , [dbo_SUPPORTER].suppID as datasourceref,
isnull([dbo_COMMUNICATIONS].commonurn, NULL) as seqrefnum, isnull
(organisation , 'None Available') as organisation , isnull(firstname ,
'None Available') as firstname ," _
& "isnull(lastname , 'None Available') as lastname , isnull(AddressLine1 ,
'None Available') as address1 , isnull(AddressLine2 , 'None Available') as
address2 , isnull(AddressLine3 , 'None Available') as address3 , isnull
(AddressLine4 , 'None Available') as address4 , isnull(Town , 'None
Available') as town , isnull(County , 'None Available') as county , isnull
(Postcode , 'None Available') as postcode , isnull(emailAddress , 'None
Available') as email ," _
& "isnull(TelephoneNumber , 'None Available') as telephone , isnull
(mobileNumber , 'None Available') as mobile , isnull(faxNumber , 'None
Available') as fax , [dbo_SUPPORTER].deceased as deceasedflag ,
[dbo_SUPPORTER].goneaway as goneaway , [dbo_SUPPORTER].dataProtection as
dataprotectionflag FROM [dbo_COMMUNICATIONS] right join [dbo_SUPPORTER] ON
[dbo_COMMUNICATIONS].suppid = [dbo_SUPPORTER].suppid where [dbo_SUPPORTER]
..emailaddress LIKE" & str_SearchEmail & ""
write the results to table1 in database2. When I run the following I get a
message:
"Wrong number of arguments used with function in query expression - 3075"
using Access 2000. The code breaks at the first isnull function. Can anyone
point me in the right direction to resolving this. It would be grately
appreciated.
-----CODE------
DoCmd.RunSQL "INSERT INTO [dbo_LOCALEXTRACTION]" _
& "(datasource , datasourceref , seqrefnum , organisation , firstname ,
lastname , address1 ,address2 , address3 , address4 , town , county ,
postcode , email , telephone , mobile , fax , deceasedflag , goneawayflag ,
dataprotectionflag)" _
& "SELECT NULL as datasource , [dbo_SUPPORTER].suppID as datasourceref,
isnull([dbo_COMMUNICATIONS].commonurn, NULL) as seqrefnum, isnull
(organisation , 'None Available') as organisation , isnull(firstname ,
'None Available') as firstname ," _
& "isnull(lastname , 'None Available') as lastname , isnull(AddressLine1 ,
'None Available') as address1 , isnull(AddressLine2 , 'None Available') as
address2 , isnull(AddressLine3 , 'None Available') as address3 , isnull
(AddressLine4 , 'None Available') as address4 , isnull(Town , 'None
Available') as town , isnull(County , 'None Available') as county , isnull
(Postcode , 'None Available') as postcode , isnull(emailAddress , 'None
Available') as email ," _
& "isnull(TelephoneNumber , 'None Available') as telephone , isnull
(mobileNumber , 'None Available') as mobile , isnull(faxNumber , 'None
Available') as fax , [dbo_SUPPORTER].deceased as deceasedflag ,
[dbo_SUPPORTER].goneaway as goneaway , [dbo_SUPPORTER].dataProtection as
dataprotectionflag FROM [dbo_COMMUNICATIONS] right join [dbo_SUPPORTER] ON
[dbo_COMMUNICATIONS].suppid = [dbo_SUPPORTER].suppid where [dbo_SUPPORTER]
..emailaddress LIKE" & str_SearchEmail & ""