Auto Populate Column

  • Thread starter NeonSky via AccessMonster.com
  • Start date
N

NeonSky via AccessMonster.com

Hello All!

Say table "ZOO" is about to be updated with an update query. Within has
column "CAGE", there are an infinite number of variables that will populate
this column. Post update query there are null records in column "CAGE". Here
is my question, how do I auto-populate those null fields with "NOCAGE".

Your assistance is much appreciated!
 
J

John Vinson

Hello All!

Say table "ZOO" is about to be updated with an update query. Within has
column "CAGE", there are an infinite number of variables that will populate
this column. Post update query there are null records in column "CAGE". Here
is my question, how do I auto-populate those null fields with "NOCAGE".

Your assistance is much appreciated!

Update the CAGE field to

NZ([Cage], "NOCAGE")

The NZ (Null To Zero) function returns the first argument's value if
that value is non-NULL, and its second argument if it is NULL.


John W. Vinson[MVP]
 
N

NeonSky via AccessMonster.com

Hello John,

Thank you for your response!

Within the query design window I entered the expression below, though a msg
box appears stating "Query must have a destination field".

What am I missing?

Thanks!!

John said:
Hello All!
[quoted text clipped - 4 lines]
Your assistance is much appreciated!

Update the CAGE field to

NZ([Cage], "NOCAGE")

The NZ (Null To Zero) function returns the first argument's value if
that value is non-NULL, and its second argument if it is NULL.

John W. Vinson[MVP]
 
N

NeonSky via AccessMonster.com

Hello John,

I sorted it out. Thanks!

I do have another question if you have a moment. Say I would like to populate
column "CAGE" with "x" number of variables. The variable that gets populated
in any given field within column cage will be dependent on criteria that
matches that of existing queries, would I have to do an update query for each
variable? Or is there a more efficient method?

Thanks in advance!
Hello John,

Thank you for your response!

Within the query design window I entered the expression below, though a msg
box appears stating "Query must have a destination field".

What am I missing?

Thanks!!
[quoted text clipped - 10 lines]
John W. Vinson[MVP]
 
J

John Vinson

Hello John,

I sorted it out. Thanks!

I do have another question if you have a moment. Say I would like to populate
column "CAGE" with "x" number of variables. The variable that gets populated
in any given field within column cage will be dependent on criteria that
matches that of existing queries, would I have to do an update query for each
variable? Or is there a more efficient method?

I have no idea, since your statement is pretty ambiguous. You may be
able to update to the result of a Switch() function call; or you might
want to have another table. The fact that the value of CAGE depends on
the value(s?) of other fields is suspicious - that suggests incomplete
normalization!

John W. Vinson[MVP]
 
Top