A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DLookup you cancelled the previous operation



 
 
Thread Tools Display Modes
  #1  
Old April 16th, 2008, 03:15 PM posted to microsoft.public.access.forms
Maverick6197
external usenet poster
 
Posts: 4
Default DLookup you cancelled the previous operation

Does anyone know what is wrong with the following code:

I'm trying to use this to pull an e-mail address from a table based on the
dealer and then e-mail a report to that e-mail using the Win2pdf mail helper
program. Everything seems to work fine except the DLookup....

__________________________________________________ _________________________

Dim AUTACCode As String

AUTACCode = DLookup("[E-MAIL_CONTACT]", "tblMasterDealerContact", "
[AUTAC_LOOKUP_CODE] = '" & Me![txtAUTACLookup] & "'")

E-MAIL_CONTACT is a field in tblMasterDealerContact
AUTAC_LOOKUP_CODE is a field in tblMasterDealerContact

SaveWin2PDFDword "file options", &H41
SaveSetting "Dane Prairie Systems", "Win2PDF", "PDFMailRecipients",
AUTACCode
SaveSetting "Dane Prairie Systems", "Win2PDF", "PDFMailSubject",
"Warranty Request Denial Notification"
SaveSetting "Dane Prairie Systems", "Win2PDF", "PDFMailNote", "Please see
the attached document concerning a Warranty Request filed with Astec
Underground."
SaveSetting "Dane Prairie Systems", "Win2PDF", "PDFFileName", "C:\
Documents and Settings\cau1042\Desktop\rptDeniedClaim.pdf"
DoCmd.OpenReport "rptDeniedClaim", acViewNormal

__________________________________________________ ______________________________


txtAUTACLookup is a control on my form. Its data source is =((Forms!frmClaim!
cmbDealerNumber) & "WM")

Everytime I run the code it gives me the "You cancelled the previous
operation." error.

The 2 fields from my table actually have spaces not underscores, but I've
tried it both ways.

tblMasterDealerContact is a linked Excel file.

Any help would be greatly apprecitated. Thanks again.

Shannan

  #2  
Old April 16th, 2008, 03:29 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default DLookup you cancelled the previous operation

That error is misleading. It usually means one of the names in the DLookup
doesn't match the names in the table. The issue is that Access sends the
request to Jet and waits for a reply. Jet can't find the name, so can't
complete the request, so it tells Access it has canceled the request. Access
then raises that error.
Be sure the spelling of all the names both table and field are correct. The
only other thing is to ensure your syntax is correct for the data type of the
field in the criteria argument. As written, it is expecting
[AUTAC_LOOKUP_CODE] to be a text data type.
--
Dave Hargis, Microsoft Access MVP


"Maverick6197" wrote:

Does anyone know what is wrong with the following code:

I'm trying to use this to pull an e-mail address from a table based on the
dealer and then e-mail a report to that e-mail using the Win2pdf mail helper
program. Everything seems to work fine except the DLookup....

__________________________________________________ _________________________

Dim AUTACCode As String

AUTACCode = DLookup("[E-MAIL_CONTACT]", "tblMasterDealerContact", "
[AUTAC_LOOKUP_CODE] = '" & Me![txtAUTACLookup] & "'")

E-MAIL_CONTACT is a field in tblMasterDealerContact
AUTAC_LOOKUP_CODE is a field in tblMasterDealerContact

SaveWin2PDFDword "file options", &H41
SaveSetting "Dane Prairie Systems", "Win2PDF", "PDFMailRecipients",
AUTACCode
SaveSetting "Dane Prairie Systems", "Win2PDF", "PDFMailSubject",
"Warranty Request Denial Notification"
SaveSetting "Dane Prairie Systems", "Win2PDF", "PDFMailNote", "Please see
the attached document concerning a Warranty Request filed with Astec
Underground."
SaveSetting "Dane Prairie Systems", "Win2PDF", "PDFFileName", "C:\
Documents and Settings\cau1042\Desktop\rptDeniedClaim.pdf"
DoCmd.OpenReport "rptDeniedClaim", acViewNormal

__________________________________________________ ______________________________


txtAUTACLookup is a control on my form. Its data source is =((Forms!frmClaim!
cmbDealerNumber) & "WM")

Everytime I run the code it gives me the "You cancelled the previous
operation." error.

The 2 fields from my table actually have spaces not underscores, but I've
tried it both ways.

tblMasterDealerContact is a linked Excel file.

Any help would be greatly apprecitated. Thanks again.

Shannan


  #3  
Old April 16th, 2008, 03:54 PM posted to microsoft.public.access.forms
Maverick6197
external usenet poster
 
Posts: 4
Default DLookup you cancelled the previous operation

Yes. [AUTAC_LOOKUP_CODE] is a text field as are the rest of the fields in
the code.

Klatuu wrote:
That error is misleading. It usually means one of the names in the DLookup
doesn't match the names in the table. The issue is that Access sends the
request to Jet and waits for a reply. Jet can't find the name, so can't
complete the request, so it tells Access it has canceled the request. Access
then raises that error.
Be sure the spelling of all the names both table and field are correct. The
only other thing is to ensure your syntax is correct for the data type of the
field in the criteria argument. As written, it is expecting
[AUTAC_LOOKUP_CODE] to be a text data type.
Does anyone know what is wrong with the following code:

[quoted text clipped - 40 lines]

Shannan


  #4  
Old April 16th, 2008, 03:55 PM posted to microsoft.public.access.forms
Maverick6197
external usenet poster
 
Posts: 4
Default DLookup you cancelled the previous operation

Nevermind. I took the underscores out of the equation and it worked. Thanks
for your help.

Maverick6197 wrote:
Yes. [AUTAC_LOOKUP_CODE] is a text field as are the rest of the fields in
the code.

That error is misleading. It usually means one of the names in the DLookup
doesn't match the names in the table. The issue is that Access sends the

[quoted text clipped - 10 lines]

Shannan


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.