another "if" question

  • Thread starter Thread starter Matt B.
  • Start date Start date
M

Matt B.

I'm trying to do something I think is very simple, but
help instructions aren't helping me out.

Working in a regular table, I'm trying to get one field to
automatically fill in with data depending on the data of
another field. (In this case, when a certain client type
is entered, I want the next field to automatically fill in
a certain value depending upon the client type.)

Is this possible and how? Thanks!

Matt
 
Use the Afterupdate Event of your form control to run a DLookup (or make
your first control a combo and "push" the data from one of the combo's
columns into your second control) ... you ARE entering this data through a
form, right?
 
I'm trying to do something I think is very simple, but
help instructions aren't helping me out.

Working in a regular table, I'm trying to get one field to
automatically fill in with data depending on the data of
another field. (In this case, when a certain client type
is entered, I want the next field to automatically fill in
a certain value depending upon the client type.)

It's a BAD IDEA. If the second field can always be determined
unambiguously from the client type, don't store it in your table at
all - just use a query linking to the table with that translation.
 
Matt B. said:
I'm trying to do something I think is very simple, but
help instructions aren't helping me out.

Working in a regular table, I'm trying to get one field to
automatically fill in with data depending on the data of
another field. (In this case, when a certain client type
is entered, I want the next field to automatically fill in
a certain value depending upon the client type.)

Is this possible and how? Thanks!

There are no events for tables, nor should users be allowed into the tables.
Write queries on the tables and use a form to enter/view/edit the data.
Forms have events. You can use a datasheet form which looks exactly like a
table, but has events.

More importantly, you are breaking Normalization rules by having 1 field
depend upon another. If the second field is ALWAYS the same, depending upon
the client type, you never need to fill it in (store it), but instead can
display it as a value calculated in a query. If the second value is one of a
number of possiblities based on the client type, use the AfterUpdate event
of the first text box to requery a combo box whose controlsource uses the
value in the first text box as criteria.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top