Update 25% to one field 75% to other

  • Thread starter Thread starter dbl
  • Start date Start date
D

dbl

Hi I have a situation where I need to update one field with 25% of the work
and the remaining 75% to the other field.

The code below is how it is set up now.

I need it to allocate 75% of the claims to field PIPossDon (which is a new
field) and only 25% to the field PIPoss

If Me.cboClaimCode.Column(3) = 1 Then
Me.PIPoss = True
Else
Me.PIPoss = False
End If

How do I go about this? As you can see it will only update the field PIPoss
to true if the ClaimCode = Column 3 which is where it still needs to get the
infomation from to update the 2 fields.

Any help would be very much appreciated.

Bob
 
There are a lot of unanswered questions here:

1. 25% and 75% of what? You can only take a percentage of a finite value.

2. Do you really need to update a field, or do you need to display the
values in a form or report?

For the second choice a calculation in a query, or in the form/report,
should be sufficient. Since very few calculations ever need to be saved,
think carefully at the second choice, because you can always display a
percentage value without storing it.
 
Hi the fields are tick boxes from these boxes we allocated work to two
departments via reports currently all the work goes to one department.

I want to split the work allocation and by using 2 tick boxes which works
fine, but you to do it manually. Plus you have to rely on everyone
remembering how many times they have ticked the boxes. It was automated
before using the code below so no one had to remember to do anything but
again it was only going to one department.

The question is how do I get it to tick the tick box PIPossDon 3 times which
would be in 3 different new records where it meets the correct criteria and
on the 4 time (again in a new record) it ticks
tick box PIPoss where again it meets the correct criteria.

I need a means of knowing that I have ticked the PIPossDon 3 times and then
next time it needs to tick the PIPoss reset the counter and so on.

Does that explain it better?

Bob
 
You can do it within a session by using a form-level variable (Untested
code):

Option Compare Database
Option Explicit

Dim intCounter As Integer
intCounter = 0

Sub chkWhatever_Click()
If Me.chkWhatever = True Then
intCounter = intCounter + 1
End If

If intCounter < 4 Then
' Send to Dept 1
Else
' Send to Dept 2
intCounter = 0 ' reset the counter
End If
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Back
Top