Can access automatically fill in a field on a form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

First let me say that I am a new user and am very susceptible to OHS errors
(Operator Head Space). I am building a new database so that my family can
use it to log our SCUBA dives that we do. After a dive at a given depth for
a given time, you are categorized as being in a given "pressure group". For
example, if you dive to 30 feet for 28 minutes you are in pressure group "E".
The pressure groups are all represented as letters.

I am curious as to whether or not Access will automatically fill out the
"pressure group" field based off the values that are entered in the "Depth"
and the "Time" fields. Currently, I have all of the fields set up as text
boxes. I have no references to tables, nor do I even know if that is what I
need to do. I have tried using macros as well as using the code, and both
attempts have failed miserably as I have no idea how to use either of them.

Thanks to whoever has the patience to help me out. I appreciate everyone's
technical skills and abilities.
 
Hi, KiloLath.

If the dive depth and time fully define a pressure group, a pressure group
field is redundant. Use a calculated field to *display* the pressure group
in a control on your form.

The easiest way, I think, is to include this calculated field in a query,
and base your form on the query rather than the table itself. Depending on
the complexity of the computation, it might be easiest done with a custom
function. Post the detail of how you determine the pressure group from the
depth and time, and I can give you the code for it.

Sprinks
 
Back
Top