query creates table records

M

Mark

Table:

txt_ClientName(primary key) int_RatingA int_RatingB
Bob 3 4
Steve 5 9
Mike 9 7




query
aut_id txt_clientName Address
1 Bob Blah
2 Steve foo
3 Mike fooblah
*4 Mary hooplah

Is there a way in access to have a query or some sort of other set up
that if there is a client Added to the Query a similar record gets added
in the table with either blank or default values for ratingA and B?



thanks
mark
 
P

pete

You can use the default value property in the field
settings for int_rating A and B. Whatever you enter would
be automatically entered in that field for new records.
 
M

[MVP] S.Clark

You would need to add code to do this. Read about the AfterUpdate property
for a form.
 
J

John Vinson

Is there a way in access to have a query or some sort of other set up
that if there is a client Added to the Query a similar record gets added
in the table with either blank or default values for ratingA and B?

well... yes, it's possible. But it's a Bad Idea. Storing empty
"placeholder" records (which you assume will someday get valid Ratings
entered) is usually neither necessary nor prudent! They have a way of
never getting updated.

Another concern: the Primary Key should be a unique, controlled,
stable value (such as an Autonumber), rather than a non-unique,
uncontrolled, changeable value such as a person's name.

Normally you would simply have two tables (People and Ratings) in a
one to many (or, very rarely and only for special purposes) one to one
relationship; if you use a Form for people, and a Subform for ratings,
a new ratings record will be created when and only when there is data
to put into the rating field.
 
Top