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  

Tag Property



 
 
Thread Tools Display Modes
  #1  
Old October 27th, 2009, 02:29 PM posted to microsoft.public.access.forms
ann
external usenet poster
 
Posts: 462
Default Tag Property

I'm sorry if this shows up multiple places. I tried to enter it into the
Programming group put it does not show up so I am trying somewhere else.

First let me say I'm not a programmer so I appreciate any help that is
offered.

Someone has helped me with the code below. Each tag property on each
control has either a 10 for Low Risk, 100 for Medium Risk and 1000 for High
Risk. Each control has an AfterUpdate event that will call the sub Risk.
This then will populate the txtRisk control which will put the appropriate
checkmark in an option group checkbox. The problem is that they are all high
because it's added all of them not just those that are checked. How do I get
it to only add the value in the tag property to the RiskValue if the checkbox
is checked? Thank you again for any help I receive.

Public Sub Risk()

Dim RiskValue As Integer

RiskValue = RiskValue + CInt([Forms]![Main]![SSN].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Name].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![DOB].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Address].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Phone].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![email].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Med Record].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![HP Beneficiary].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Account].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Certificate].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![License].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Full Face Photo].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Vehicle].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Web URL].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Internet Address].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Finger Print].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Voice Print].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Health Info].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Other].Tag)

If RiskValue 1000 And RiskValue 8480 Then
txtRisk = 1
End If

If RiskValue 100 And RiskValue 480 Then
txtRisk = 2
End If

If RiskValue 0 And RiskValue 80 Then
txtRisk = 3
End If

End Sub

  #2  
Old October 27th, 2009, 03:33 PM posted to microsoft.public.access.forms
Mr. B[_4_]
external usenet poster
 
Posts: 171
Default Tag Property

Ann,

You will need to modify each line of the code that is adding the value so
that it will evaluate the condition of the checkbox associated with the text
box. For example:

If [Forms]![Main]![NameOfCheckBox] = true then
RiskValue = RiskValue + CInt([Forms]![Main]![SSN].Tag)
end if

You will need to substitue the "NameOfCheckBox" in the code above with the
actual name of the checkbox associated with the "SSN" field.

You will also need to make this type of change for each of the fields
represented by one of the lines of code.

-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm


"Ann" wrote:

I'm sorry if this shows up multiple places. I tried to enter it into the
Programming group put it does not show up so I am trying somewhere else.

First let me say I'm not a programmer so I appreciate any help that is
offered.

Someone has helped me with the code below. Each tag property on each
control has either a 10 for Low Risk, 100 for Medium Risk and 1000 for High
Risk. Each control has an AfterUpdate event that will call the sub Risk.
This then will populate the txtRisk control which will put the appropriate
checkmark in an option group checkbox. The problem is that they are all high
because it's added all of them not just those that are checked. How do I get
it to only add the value in the tag property to the RiskValue if the checkbox
is checked? Thank you again for any help I receive.

Public Sub Risk()

Dim RiskValue As Integer

RiskValue = RiskValue + CInt([Forms]![Main]![SSN].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Name].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![DOB].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Address].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Phone].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![email].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Med Record].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![HP Beneficiary].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Account].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Certificate].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![License].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Full Face Photo].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Vehicle].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Web URL].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Internet Address].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Finger Print].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Voice Print].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Health Info].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Other].Tag)

If RiskValue 1000 And RiskValue 8480 Then
txtRisk = 1
End If

If RiskValue 100 And RiskValue 480 Then
txtRisk = 2
End If

If RiskValue 0 And RiskValue 80 Then
txtRisk = 3
End If

End Sub

  #3  
Old October 27th, 2009, 04:16 PM posted to microsoft.public.access.forms
ann
external usenet poster
 
Posts: 462
Default Tag Property

Hi,

I made the changes but nothing happens. The checkboxes are checked but
nothing appears in the txtRisk box. Here is how it looks now. I something
typed incorrectly?

Public Sub Risk()

Dim RiskValue As Integer

If [Forms]![Main]![SSN] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![SSN].Tag)
If [Forms]![Main]![Name] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Name].Tag)
If [Forms]![Main]![DOB] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![DOB].Tag)
If [Forms]![Main]![Address] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Address].Tag)
If [Forms]![Main]![Phone] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Phone].Tag)
If [Forms]![Main]![email] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![email].Tag)
If [Forms]![Main]![Med Record] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Med Record].Tag)
If [Forms]![Main]![HP Beneficiary] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![HP Beneficiary].Tag)
If [Forms]![Main]![Account] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Account].Tag)
If [Forms]![Main]![Certificate] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Certificate].Tag)
If [Forms]![Main]![License] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![License].Tag)
If [Forms]![Main]![Full Face Photo] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Full Face Photo].Tag)
If [Forms]![Main]![Vehicle] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Vehicle].Tag)
If [Forms]![Main]![Web URL] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Web URL].Tag)
If [Forms]![Main]![Internet Address] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Internet Address].Tag)
If [Forms]![Main]![Finger Print] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Finger Print].Tag)
If [Forms]![Main]![Voice Print] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Voice Print].Tag)
If [Forms]![Main]![Health Info] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Health Info].Tag)
If [Forms]![Main]![Other] = True Then RiskValue = RiskValue +
CInt([Forms]![Main]![Other].Tag)

If RiskValue 1000 And RiskValue 8480 Then
txtRisk = 1
End If

If RiskValue 100 And RiskValue 480 Then
txtRisk = 2
End If

If RiskValue 0 And RiskValue 80 Then
txtRisk = 3
End If

End Sub


"Mr. B" wrote:

Ann,

You will need to modify each line of the code that is adding the value so
that it will evaluate the condition of the checkbox associated with the text
box. For example:

If [Forms]![Main]![NameOfCheckBox] = true then
RiskValue = RiskValue + CInt([Forms]![Main]![SSN].Tag)
end if

You will need to substitue the "NameOfCheckBox" in the code above with the
actual name of the checkbox associated with the "SSN" field.

You will also need to make this type of change for each of the fields
represented by one of the lines of code.

-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm


"Ann" wrote:

I'm sorry if this shows up multiple places. I tried to enter it into the
Programming group put it does not show up so I am trying somewhere else.

First let me say I'm not a programmer so I appreciate any help that is
offered.

Someone has helped me with the code below. Each tag property on each
control has either a 10 for Low Risk, 100 for Medium Risk and 1000 for High
Risk. Each control has an AfterUpdate event that will call the sub Risk.
This then will populate the txtRisk control which will put the appropriate
checkmark in an option group checkbox. The problem is that they are all high
because it's added all of them not just those that are checked. How do I get
it to only add the value in the tag property to the RiskValue if the checkbox
is checked? Thank you again for any help I receive.

Public Sub Risk()

Dim RiskValue As Integer

RiskValue = RiskValue + CInt([Forms]![Main]![SSN].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Name].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![DOB].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Address].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Phone].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![email].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Med Record].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![HP Beneficiary].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Account].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Certificate].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![License].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Full Face Photo].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Vehicle].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Web URL].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Internet Address].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Finger Print].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Voice Print].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Health Info].Tag)
RiskValue = RiskValue + CInt([Forms]![Main]![Other].Tag)

If RiskValue 1000 And RiskValue 8480 Then
txtRisk = 1
End If

If RiskValue 100 And RiskValue 480 Then
txtRisk = 2
End If

If RiskValue 0 And RiskValue 80 Then
txtRisk = 3
End If

End Sub

  #4  
Old October 27th, 2009, 04:54 PM posted to microsoft.public.access.forms
NG
external usenet poster
 
Posts: 56
Default Tag Property

Hi Ann

Are you sure that [Forms]![Main]![Name] or [Forms]![Main]![SSN] are the
names of the checkboxes?

The code says:

if [forms]![Main]![NameOfTheCheckbox] then RiskValue = RiskValue +
CInt([Forms]![Main]![NameOftheCorrespondingFieldWithTheTag].Tag)
So check that in the first part you use the names of the checkboxes.

kind regards
NG

"Ann" wrote:

Hi,

I made the changes but nothing happens. The checkboxes are checked but
nothing appears in the txtRisk box. Here is how it looks now. I something
typed incorrectly?


  #5  
Old October 27th, 2009, 05:09 PM posted to microsoft.public.access.forms
ann
external usenet poster
 
Posts: 462
Default Tag Property

Instead of If [Forms]![Main]![NameOfCheckBox] = true then RiskValue =
RiskValue + CInt([Forms]![Main]![SSN].Tag)
end if

I had to type [Forms]![Main]![NameOfCheckBox].Value = -1 and add = to the
and then everything worked. I still have one problem though because if I
click off a checkbox without picking a different box I'm stuck with the risk
that was originally assigned. How do I get them to not be counted if the
checkbox is unchecked?

"NG" wrote:

Hi Ann

Are you sure that [Forms]![Main]![Name] or [Forms]![Main]![SSN] are the
names of the checkboxes?

The code says:

if [forms]![Main]![NameOfTheCheckbox] then RiskValue = RiskValue +
CInt([Forms]![Main]![NameOftheCorrespondingFieldWithTheTag].Tag)
So check that in the first part you use the names of the checkboxes.

kind regards
NG

"Ann" wrote:

Hi,

I made the changes but nothing happens. The checkboxes are checked but
nothing appears in the txtRisk box. Here is how it looks now. I something
typed incorrectly?


  #6  
Old October 27th, 2009, 05:21 PM posted to microsoft.public.access.forms
ann
external usenet poster
 
Posts: 462
Default Tag Property

I thing I got it. I changed the lowest risk to be =1 and then added a few
more lines if the risk is 0. Since that's the default for the option group
it turns off the previously chosen checkbox.

If RiskValue = 1 And RiskValue = 80 Then
txtRisk = 3
End If

If RiskValue = 0 Then
txtRisk = 0
End If


"Ann" wrote:

Instead of If [Forms]![Main]![NameOfCheckBox] = true then RiskValue =
RiskValue + CInt([Forms]![Main]![SSN].Tag)
end if

I had to type [Forms]![Main]![NameOfCheckBox].Value = -1 and add = to the
and then everything worked. I still have one problem though because if I
click off a checkbox without picking a different box I'm stuck with the risk
that was originally assigned. How do I get them to not be counted if the
checkbox is unchecked?

"NG" wrote:

Hi Ann

Are you sure that [Forms]![Main]![Name] or [Forms]![Main]![SSN] are the
names of the checkboxes?

The code says:

if [forms]![Main]![NameOfTheCheckbox] then RiskValue = RiskValue +
CInt([Forms]![Main]![NameOftheCorrespondingFieldWithTheTag].Tag)
So check that in the first part you use the names of the checkboxes.

kind regards
NG

"Ann" wrote:

Hi,

I made the changes but nothing happens. The checkboxes are checked but
nothing appears in the txtRisk box. Here is how it looks now. I something
typed incorrectly?


 




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 11:55 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.