Problem with checkbox in form

  • Thread starter Thread starter Skylar Andersen
  • Start date Start date
S

Skylar Andersen

I am trying to use a checkbox to allow the user to choose
a customer from a subform. The checkbox is defined in the
original table. The control source for the subform is a
SELECT DISTINCTROW SQL statement. I can see the control
when I run the form's underlying query, but I cannot
check or uncheck the box. Does it have something to do
with the control source? If so, how do I fix it?

Thank you.

You may respond to (e-mail address removed) or this forum.
 
Hi Skylar

If the checkbox is part of the result of the SELECT DISTINCTROW query, you need to remove "DISTINCTROW". DISTINCTROW is like an aggregate query GROUP BY clause which means that all records with the same values will show up as one record in the results. Since the resulting record doesn't refer to a single record in the original table, the database doesn't know which record you want to change when you try to update it (like by checking a check box), so it won't let you

I hope this helps

Corrina Burnle
Burnley Data Solution
www.burnleydatasolutions.co

----- Skylar Andersen wrote: ----

I am trying to use a checkbox to allow the user to choose
a customer from a subform. The checkbox is defined in the
original table. The control source for the subform is a
SELECT DISTINCTROW SQL statement. I can see the control
when I run the form's underlying query, but I cannot
check or uncheck the box. Does it have something to do
with the control source? If so, how do I fix it

Thank you

You may respond to (e-mail address removed) or this forum
 
Thank you for your help. I removed the DISTINCTROW and
the GROUP BY and it worked just fine!
-----Original Message-----
Hi Skylar,

If the checkbox is part of the result of the SELECT
DISTINCTROW query, you need to remove "DISTINCTROW".
DISTINCTROW is like an aggregate query GROUP BY clause
which means that all records with the same values will
show up as one record in the results. Since the resulting
record doesn't refer to a single record in the original
table, the database doesn't know which record you want to
change when you try to update it (like by checking a
check box), so it won't let you.
 
Back
Top