Auto Populate


A

AGOKP4

Hi all,

I need help on a form I created in access 2003 version for a study I'm
working on. I need to summarize some of the data in 3 groups (<1.0, 1.0-1.4
and >1.4) and have created the form as such.

What I need is to be able to enter data in a certain field on the
form...lets say 0.05 and have the <1.0 group field automatically
checked/populated OR enter 1.3 and have the 1.0-1.4 group automatically
checked/populated....

THANKS!!!
 
Ad

Advertisements

W

Wayne-I-M

Hi

You need to give information about what it is you want, as an example you
could use something like this

if you wanted to enter data into only one box ( that is delete anything in
the other boxes)

Private Sub SomeControl_AfterUpdate()
If Me.SomeControl < 1 Then
Me.LessThan1 = Me.SomeControl
Me.MoreThan1ButLessThan1point4 = Null
Me.Onepoint4OrMore = Null
Else
If Me.SomeControl >= 1 And Me.SomeControl < 1.4 Then
Me.MoreThan1ButLessThan1point4 = Me.SomeControl
Me.LessThan1 = Null
Me.Onepoint4OrMore = Null
Else
If Me.SomeControl >= 1.4 Then
Me.Onepoint4OrMore = Me.SomeControl
Me.LessThan1 = Null
Me.MoreThan1ButLessThan1point4 = Null
End If
End If
End If
End Sub


Or - if you wanted to add data into more than one box, something like

Private Sub SomeControl_AfterUpdate()
If Me.SomeControl < 1 Then
Me.LessThan1 = Me.SomeControl
Else
If Me.SomeControl >= 1 And Me.SomeControl < 1.4 Then
Me.MoreThan1ButLessThan1point4 = Me.SomeControl
Else
If Me.SomeControl >= 1.4 Then
Me.Onepoint4OrMore = Me.SomeControl
End If
End If
End If
End Sub

If you post more details think someone should be able to help. Or you could
overwrite data in one box and use this to do "something" to the others, etc
etc etc
 
A

AGOKP4

Hello Wayne,

Thanks for your reply. So I have a field/text box " Creatinine" where we
enter the value of a study participant. I want another field called
"creatinine Group" to be automatically with the group the creatinine value
belongs to. Hope this explains it further.

How do i use the info you sent? In the "properties" section of the
Creatinine group field under Control source?

THANKS!!
 
K

kc-mass

I think you want to simply store the values in a table with their ID and
value. When you want to summarize and group them, do that with a query.

Regards

Kevin
 
A

AGOKP4

Hi Kevin,

Thanks for your reply. Can you show me the query o summarize and group them?

THANKS!!
 
W

Wayne-I-M

ooohhhhhh now I understand - sorry I though you had 3 fields in a table to
store the different amounts.

What you are looking at doing is wrong (sorry about that). You don't want
to store the results of the calculation.

All you need to do have your box (Creatinine) and one unbound box (unbound
means it is not based on a table or query field.

You need this to show the result you want (afterall that really what you
want) but don't store this result - it better to just produce it when you
need it then dump it.

So create a new text box (open the form in design view)
right click this new box and open the properties box
in the Data coloum select the control source row
Click the build option (...)

add this

=IIf([Creatinine]<1,"less than 1",IIf([Creatinine]>=1 And
[Creatinine]<1.4,"Some other text","Even ore text"))

Than add some number to Creatinine see what it does andd then change the
text to what you want.

This said - I think you will want to use this information and grouping in
reports and other forms so you may be better adding this to a query and
basing the form on the query and not the able. Just add the same calculation
to a blank column in the query (but add SomeName: instead of the 1st "=")
 
Ad

Advertisements

A

AGOKP4

GREAT!!!! Yoou solved my question...actually went with the 2nd
option..THANKS!!!!

Wayne-I-M said:
ooohhhhhh now I understand - sorry I though you had 3 fields in a table to
store the different amounts.

What you are looking at doing is wrong (sorry about that). You don't want
to store the results of the calculation.

All you need to do have your box (Creatinine) and one unbound box (unbound
means it is not based on a table or query field.

You need this to show the result you want (afterall that really what you
want) but don't store this result - it better to just produce it when you
need it then dump it.

So create a new text box (open the form in design view)
right click this new box and open the properties box
in the Data coloum select the control source row
Click the build option (...)

add this

=IIf([Creatinine]<1,"less than 1",IIf([Creatinine]>=1 And
[Creatinine]<1.4,"Some other text","Even ore text"))

Than add some number to Creatinine see what it does andd then change the
text to what you want.

This said - I think you will want to use this information and grouping in
reports and other forms so you may be better adding this to a query and
basing the form on the query and not the able. Just add the same calculation
to a blank column in the query (but add SomeName: instead of the 1st "=")





--
Wayne
Manchester, England.



AGOKP4 said:
Hello Wayne,

Thanks for your reply. So I have a field/text box " Creatinine" where we
enter the value of a study participant. I want another field called
"creatinine Group" to be automatically with the group the creatinine value
belongs to. Hope this explains it further.

How do i use the info you sent? In the "properties" section of the
Creatinine group field under Control source?

THANKS!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top