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  

Subform Question #Error



 
 
Thread Tools Display Modes
  #1  
Old February 22nd, 2010, 02:27 AM posted to microsoft.public.access.forms
Gary B
external usenet poster
 
Posts: 13
Default Subform Question #Error

Hi there,

I am using MS Access 2007 and using the new "attachment" field type.

I have a subform named "frmComplaintsHistory" that contains a control named
"Attachments" (the same name as the field in the table).

On the main form I have a textbox with the formula
"=Sum(NZ([frmComplaintsHistory]![Attachments].[attachmentcount],0))" as I
wish to see how many attachments exist for that record on the main form.

This formula is producing a "#Error" result.

I also have a textbox on the subform named "intAttachCount" with the formula
"=[Attachments].[attachmentcount]" and this is producing a correct result.

Q1. Any suggestions as to how to fix the #Error message.
Q2. I would also like to extract the name(s) of the attachments and attach
them to an email, if an attachment exists. (I am using teh Outlook Object).

Regards

  #2  
Old February 22nd, 2010, 02:41 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Subform Question #Error

Gary -

The =Sum() will only work in the header/footer of the form (in this case
subform) you are summing records for. Look at the DCOUNT function to use on
the main form.

Maybe someone else can help with the attachment question...

--
Daryl S


"Gary B" wrote:

Hi there,

I am using MS Access 2007 and using the new "attachment" field type.

I have a subform named "frmComplaintsHistory" that contains a control named
"Attachments" (the same name as the field in the table).

On the main form I have a textbox with the formula
"=Sum(NZ([frmComplaintsHistory]![Attachments].[attachmentcount],0))" as I
wish to see how many attachments exist for that record on the main form.

This formula is producing a "#Error" result.

I also have a textbox on the subform named "intAttachCount" with the formula
"=[Attachments].[attachmentcount]" and this is producing a correct result.

Q1. Any suggestions as to how to fix the #Error message.
Q2. I would also like to extract the name(s) of the attachments and attach
them to an email, if an attachment exists. (I am using teh Outlook Object).

Regards

 




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 05:39 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.