E
epigram
I've got a form (in an app that I inherited) that has several
controls, and a subform. The main form is bound to a query. This
query can return more than one row. There are controls on the form
that are bound to columns in the query. All of this makes sense. Now
for the part(s) I'm having difficulty with.
1) The query that is bound to the main form always returns less
records than the number of records indicated in the main form's
navigation button area. I can achieve this latter number, in a test
query, if I eliminate a search condition from the WHERE clause. I
don't know if this is related to my main issue (number 2). It just
makes me think there is some 'magic' going on here that I'm not aware
of.
2) The issue that I'm having is that the query on the main form
returns more than one row. There is a bound control on the main form
that is bound to a column in that query. The issue is that whenever
that control is updated (via code in the form) and the record that I'm
currently viewing gets saved, ALL rows in that query get updated. In
other words the column, that is represented by the control on the main
form, gets updated for all rows that were returned in the query bound
to the main form.
I know that a form, usually, is bound (one-to-one) with a table/query.
I also know that you can hand-code a lot of operations using SQL
within a form as well. What I don't understand is how Access' "auto
save" type functionality can update all the rows in the main form's
query without me being able to see some SQL statements inside the
form. I assume that this is not Access doing this automagically and
there is some hand-coding going on somewhere in the form. I simply
cannot locate it.
Are there any hooks or procedures I should be looking for in the
code/database that would help me figure out where these rows are being
updated? I keep expecting to see some code in the main form like an
_OnSave method that would contain the SQL I'm expecting to find.
Could it be a macro in a table somewhere that would act as a trigger
that when a certain column is udpated, it would updated other columns
based upon some logic?
Any help would be greatly appreciated.
Thanks,
Tim
controls, and a subform. The main form is bound to a query. This
query can return more than one row. There are controls on the form
that are bound to columns in the query. All of this makes sense. Now
for the part(s) I'm having difficulty with.
1) The query that is bound to the main form always returns less
records than the number of records indicated in the main form's
navigation button area. I can achieve this latter number, in a test
query, if I eliminate a search condition from the WHERE clause. I
don't know if this is related to my main issue (number 2). It just
makes me think there is some 'magic' going on here that I'm not aware
of.
2) The issue that I'm having is that the query on the main form
returns more than one row. There is a bound control on the main form
that is bound to a column in that query. The issue is that whenever
that control is updated (via code in the form) and the record that I'm
currently viewing gets saved, ALL rows in that query get updated. In
other words the column, that is represented by the control on the main
form, gets updated for all rows that were returned in the query bound
to the main form.
I know that a form, usually, is bound (one-to-one) with a table/query.
I also know that you can hand-code a lot of operations using SQL
within a form as well. What I don't understand is how Access' "auto
save" type functionality can update all the rows in the main form's
query without me being able to see some SQL statements inside the
form. I assume that this is not Access doing this automagically and
there is some hand-coding going on somewhere in the form. I simply
cannot locate it.
Are there any hooks or procedures I should be looking for in the
code/database that would help me figure out where these rows are being
updated? I keep expecting to see some code in the main form like an
_OnSave method that would contain the SQL I'm expecting to find.
Could it be a macro in a table somewhere that would act as a trigger
that when a certain column is udpated, it would updated other columns
based upon some logic?
Any help would be greatly appreciated.
Thanks,
Tim