Adding Fields that are text

  • Thread starter Thread starter Charlene
  • Start date Start date
C

Charlene

I was wondering if you can add data that is text. In my
attendance record form I have certain values that go into
the different dates(i.e. X=Present, A=Absent). At the end
of the row I am trying to build an expression that will
give me a sum for the number of x's that are in the row.
I have had no luck so far and I am not sure if access is
capable of doing this. Please let me know if this can be
done.

Thank You
Charlene
 
Hi Charlene,

The way your data is structured (not normalized) the following is the only
workaround I can think of off the top of my head. I guessing that you are
content with your Form and just need to add this last piece:

- For each textbox that has a date add a new one for it but for the new one
include the formula
=IIF([original textbox]="X", 1, 0)

So you would have something like

Original textbox New textbox Control Source for New textbox
Date1 calcDate1 =IIF([Date1]="X",1,0)
Date2 calcDate2 =IIF([Date2]="X",1,0)
Date3 calcDate3 =IIF([Date3]="X",1,0)
Date4 calcDate4 =IIF([Date4]="X",1,0)

Then create another text box that will have the total result, example:
=[calcDate1]+[calcDate2]+[calcDate3]+[calcDate4]


NOTE: you of course could make the textboxes "calcDate1....Date4" NOT
visible.

Other than the above you would have to normalize your database.


I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights


--------------------
| Content-Class: urn:content-classes:message
| From: "Charlene" <[email protected]>
| Sender: "Charlene" <[email protected]>
| Subject: Adding Fields that are text
| Date: Mon, 19 Jul 2004 13:57:39 -0700
| Lines: 11
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcRt0wbilUlsZOq5ThWM8e8SUJT82g==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.access.forms
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.forms:273171
| NNTP-Posting-Host: tk2msftngxa13.phx.gbl 10.40.1.165
| X-Tomcat-NG: microsoft.public.access.forms
|
| I was wondering if you can add data that is text. In my
| attendance record form I have certain values that go into
| the different dates(i.e. X=Present, A=Absent). At the end
| of the row I am trying to build an expression that will
| give me a sum for the number of x's that are in the row.
| I have had no luck so far and I am not sure if access is
| capable of doing this. Please let me know if this can be
| done.
|
| Thank You
| Charlene
|
 
Eric,

Thank You so much. It worked!

Charlene
-----Original Message-----
Hi Charlene,

The way your data is structured (not normalized) the following is the only
workaround I can think of off the top of my head. I guessing that you are
content with your Form and just need to add this last piece:

- For each textbox that has a date add a new one for it but for the new one
include the formula
=IIF([original textbox]="X", 1, 0)

So you would have something like

Original textbox New textbox Control Source for New textbox
Date1 calcDate1 =IIF ([Date1]="X",1,0)
Date2 calcDate2 =IIF ([Date2]="X",1,0)
Date3 calcDate3 =IIF ([Date3]="X",1,0)
Date4 calcDate4 =IIF ([Date4]="X",1,0)

Then create another text box that will have the total result, example:
=[calcDate1]+[calcDate2]+[calcDate3]+ [calcDate4]


NOTE: you of course could make the
textboxes "calcDate1....Date4" NOT
 
Back
Top