Syntax Problem help needed

ausmoran

Registered User.
Local time
Today, 01:07
Joined
Aug 30, 2001
Messages
13
I have a piece of VBA code in which I have a SQL insert statement with a problem. I think there is a relatively simple syntax error that I can't seem to find and am hoping that somebody might be able to take a look at it and point it out for me. Here's what I have:
Code:
sql = "insert into dbo_tbl_Call (Member_Number,CallDate,Question,Answer,StartTime,StopTime,CallDurationMinutes,Commission,CommissionBetweenBrokers,CommissionBetweenBrokersandAgents,CommissionBetweenBrokersandSellerBuyers,CommissionRipoff,RebateNegotiationOfCommission,CommissionOther,LicenseLaw,LicenseLawAdvertising,LicenseLawOwnership,LicenseLawChangingBrokers,LicenseLawExclusiveListing,LicenseLawContinuingEducation,LicenseLawLLC,HowTo_LicenseLaw,PersonalAssistant,LicenseLawOther,FairHousing,FairHousingDiscrimination,FairHousingOther,Contract,ListingAgreement,ContractBinder,ContractPurchaseOffer,ContractMultipleCompetingOffers,ContractDepositsEscrow,ContractOther,Disclosure,DisclosureBrokerStatusAgency,DisclosurePropertyCondition,DisclosureSexOffender, _
DisclosureLeadPaint,DisclosureOther,Agnecy,BrokersAgency,SellersAgent,BuyersAgent,ChangingAgency,AgencyOther,DOS,ChangingBrokers,ComplaintForViolation,DOSother,Referrals,NonLicensees,Licensees,OutOfStateBrokers,ReferralsOther,Arbitration,ArbitrationArbitrableIssue,ArbitrationCurrentlyInArbitration,ArbitrationArbitrationCompletedAppeal,ArbitrationCompliance,ArbitrationOther,CodeOfEthics,CCodeOfEthicsViolation,CodeOfEthicsProcess,CodeOfEthicsDecision,CodeOfEthicsAppeal,CodeOfEthicsOther,BoardAssociation,MembershipIssue,ElectionIssue,ReferralAgent,BoardAssociationOther,MLS,MLSVOW,MLSIDX,MLSPolicy,MLSother,OtherHotlineIssue,DoNotCall,DoNotFax,CANSPAM,RESPA,MortgageBroker,IndependentContractor,AntiTrust,Other) " & _
"values " & _
"(" & Me.Member_Number & ",#" & Me.CallDate & "#,'" & Replace(Me.Question, "'", "''") & "','" & Replace(Me.Answer, "'", "''") & "',#" & Me. _
StartTime & "#,#" & Me.EndTime & "#," & CallDurationMinutes & _
"," & Commission & "," & CommissionBetweenBrokers & "," & CommissionBetweenBrokersandAgents & "," & CommissionBetweenBrokersandSellerBuyers & "," & CommissionRipoff & "," & RebateNegotiationOfCommission & "," & CommissionsOther & "," & LicenseLaw & "," & LicenseLawAdvertising & "," & LicenseLawOwnership & "," & LicenseLawChangingBrokers & "," & LicenseLawExclusiveListing & "," & LicenseLawContinuingEducation & "," & LicenseLawLLC & "," & _
HowTo_LicenseLaw & "," & PersonalAssistant & "," & LicenseLawOther & "," & FairHousing & "," & FairHousingDiscrimination & "," & FairHousingOther & "," & Contract & "," & ListingAgreement & "," & ContractBinder & "," & ContractPurchaseOffer & "," & ContractMultipleCompetingOffers & "," & ContractDepositsEscrow & "," & ContractOther & "," & Disclosure & "," & DisclosureBrokerStatusAgency & "," & DisclosurePropertyCondition & "," & DisclosureSexOffender & "," & _
DisclosureLeadPaint & "," & DisclosureOther & "," & Agency & "," & BrokersAgency & "," & SellersAgent & "," & BuyersAgent & "," & ChangingAgency & "," & AgencyOther & "," & DOS & "," & ChangingBrokers & "," & ComplaintForViolation & "," & DOSother & "," & Referrals & "," & NonLicensees & "," & Licensees & "," & OutOfStateBrokers & "," & ReferralsOther & "," & _
Arbitration & "," & ArbitrationArbitrableIssue & "," & ArbitrationCurrentlyInArbitration & "," & ArbitrationArbitrationCompletedAppeal & "," & ArbitrationCompliance & "," & ArbitrationOther & "," & CodeOfEthics & "," & CodeOfEthicsViolation & "," & CodeOfEthicsProcess & "," & CodeOfEthicsDecision & "," & _
CodeOfEthicsAppeal & "," & CodeOfEthicsOther & "," & BoardAssociation & "," & MembershipIssue & "," & ElectionIssue & "," & ReferralAgent & "," & BoardAssociationOther & "," & MLS & "," & MLSVOW & "," & MLSIDX & "," & MLSPolicy & "," & MLSOther & "," & OtherHotlineIssue & "," & DoNotCall & "," & DoNotFax & "," & CANSPAM & "," & RESPA & "," & MortgageBroker & "," & IndependentContractor & "," & AntiTrust & "," & Other & ")"

Thank you for looking and for any suggestions that you might be able to make on my behalf.

Austin Moran
 
Add

Debug.Print sql

right after that, run it and examine the resulting SQL statement in the immediate window. Post that SQL here if the problem doesn't jump out at you.
 
There it is (I think). You have this:

"',#" & Me. _
StartTime

Change that to:

"',#" & _
Me.StartTime

You can't split the recordset and field like that.

~Moniker
 

Users who are viewing this thread

Back
Top Bottom