Automation objects

  • Thread starter Thread starter Alain
  • Start date Start date
A

Alain

Hi to all, I am getting the following error that I do not
quite understand error 2471 "Tho object doesn't contain
the automation object [txtVendorID

this is the code I am using
num6 = DSum("[Montant]", "account", "[VendorId] =
[txtVendorID]")
Forms![MPD Corrector]![txtTotVendorID] = num6
I have checked my refewrences and the OLE Automation is
checked, Microsoft ActiveX Data Objects Library 2.7 is
also checked.

Can anyone tell me what I am doing weong

Many thanks in advance

Alain
 
The problem is that because you've put [txtVendorID] inside the quotes.

Try:

num6 = DSum("[Montant]", "account", "[VendorId] = " & [txtVendorID])

assuming VendorId is numeric, or

num6 = DSum("[Montant]", "account", "[VendorId] = " & Chr(34) &
[txtVendorID] & Chr(34))

if it's text.
 
I have tried your solution but getting a different error
" External name not defined"
I have tried also different syntax but still getting
other errors

BTY VendorId is numeric

-----Original Message-----
The problem is that because you've put [txtVendorID] inside the quotes.

Try:

num6 = DSum("[Montant]", "account", "[VendorId] = " & [txtVendorID])

assuming VendorId is numeric, or

num6 = DSum("[Montant]", "account", "[VendorId] = " & Chr (34) &
[txtVendorID] & Chr(34))

if it's text.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)


Hi to all, I am getting the following error that I do not
quite understand error 2471 "Tho object doesn't contain
the automation object [txtVendorID

this is the code I am using
num6 = DSum("[Montant]", "account", "[VendorId] =
[txtVendorID]")
Forms![MPD Corrector]![txtTotVendorID] = num6
I have checked my refewrences and the OLE Automation is
checked, Microsoft ActiveX Data Objects Library 2.7 is
also checked.

Can anyone tell me what I am doing weong

Many thanks in advance

Alain


.
 
What is txtVendorID? A variable or a control on the form? If the latter, try
Me.txtVendorID

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



I have tried your solution but getting a different error
" External name not defined"
I have tried also different syntax but still getting
other errors

BTY VendorId is numeric

-----Original Message-----
The problem is that because you've put [txtVendorID] inside the quotes.

Try:

num6 = DSum("[Montant]", "account", "[VendorId] = " & [txtVendorID])

assuming VendorId is numeric, or

num6 = DSum("[Montant]", "account", "[VendorId] = " & Chr (34) &
[txtVendorID] & Chr(34))

if it's text.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)


Hi to all, I am getting the following error that I do not
quite understand error 2471 "Tho object doesn't contain
the automation object [txtVendorID

this is the code I am using
num6 = DSum("[Montant]", "account", "[VendorId] =
[txtVendorID]")
Forms![MPD Corrector]![txtTotVendorID] = num6
I have checked my refewrences and the OLE Automation is
checked, Microsoft ActiveX Data Objects Library 2.7 is
also checked.

Can anyone tell me what I am doing weong

Many thanks in advance

Alain


.
 
Back
Top