I am trying to generate three values based on the possible outcomes for a variable (fred): 1: count of all values where fred=1. (1=yes)
2: count of all values where fred <>9 (9=not applicable)
3: percent of all values for fred where fred=1 divided by all values where fred<>9.
Here is my attempt to generate these numbers in visual basic, but I don't know how to get those three numbers back into my access report. Do I create controls, etc? I haven't a clue here.
Dim countall As Integer
Dim countone As Integer
Function prcntgc()
DoCmd.OpenTable
countall = 0
countone = 0
Do While GC <> 9
countall = countall + 1
Do While GC = 1
countone = count1 + 1
Loop
Loop
prcntgc = (count1 / countall) * 100
End Function
Thanks,
Toni
2: count of all values where fred <>9 (9=not applicable)
3: percent of all values for fred where fred=1 divided by all values where fred<>9.
Here is my attempt to generate these numbers in visual basic, but I don't know how to get those three numbers back into my access report. Do I create controls, etc? I haven't a clue here.
Dim countall As Integer
Dim countone As Integer
Function prcntgc()
DoCmd.OpenTable
countall = 0
countone = 0
Do While GC <> 9
countall = countall + 1
Do While GC = 1
countone = count1 + 1
Loop
Loop
prcntgc = (count1 / countall) * 100
End Function
Thanks,
Toni