Modifying A. Browne's "Search Criteria" tutorial to batch add" rec

A

Amanda

I've been using Allen Browne's "Search Criteria" example form
(http://allenbrowne.com/ser-62.html) to create a Animal Quick Entry form
that allows the user to preview a batch of animals based on selected
criteria(the "preview" is the continuous form in the example), remove animals
they do not want included in the batch, and then create journal records for
each of those animals in one go. The form is set up almost exactly like the
example, and is working nicely.

The next step:

I have added an unbound checkbox to the continuous form, with the intent
that when the filter is applied by selecting the Preview button, the list of
animals will be shown with a checkbox by their name automatically selected.
I added code to set the checkbox to true when the preview button is clicked,
but if I uncheck the checkbox, all the checkboxes are unchecked.

How do I associate the checkbox with that animal's record, so the checkboxes
can be unchecked individually?

I will later be adding a subform to the header to create a journal entry for
each selected animal that is checked.

Thanks, Amanda
 
M

Marshall Barton

Amanda said:
I've been using Allen Browne's "Search Criteria" example form
(http://allenbrowne.com/ser-62.html) to create a Animal Quick Entry form
that allows the user to preview a batch of animals based on selected
criteria(the "preview" is the continuous form in the example), remove animals
they do not want included in the batch, and then create journal records for
each of those animals in one go. The form is set up almost exactly like the
example, and is working nicely.

The next step:

I have added an unbound checkbox to the continuous form, with the intent
that when the filter is applied by selecting the Preview button, the list of
animals will be shown with a checkbox by their name automatically selected.
I added code to set the checkbox to true when the preview button is clicked,
but if I uncheck the checkbox, all the checkboxes are unchecked.

How do I associate the checkbox with that animal's record, so the checkboxes
can be unchecked individually?


You would have to create a field in the form's record source
table. BUT, that won't work if you ever allow more than a
single user. To allow more than one user, you would need a
local, parallel table with the PK field of the original
table along with the YesNo field.

A different approach that does not use a table is Albert
Kallal's clever trick in his Multi Select sample at:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
 
A

Amanda

Thanks for the direction! I've incorporated the example into my form, it's a
little od, because there is a command button on top of the checkbox for
selecting a record, and the button controls checking and unchecking the box.

So I'm running into a couple of issues. One is that the checkbox's Control
Source is tied to the ID field (in my case [Animal ID]), so I keep getting
errors that say "Control cannot be edited, it's bound to the expression
'IsChecked([Animal ID])"

I have not found a good reference on what tying the control source to
IsChecked([field]) does- so I'm having problems troubleshooting.

Also, the example begins with the records unchecked, and I would like all
the records in my "Preview" checked- but if I run a command to check the
checkbox when the filter is applied, I get "You can't assign a value to the
object" - which is probably for the same reason.

Could you help me understand what tying this control source to the checkbox
is doing?

Thanks, Amanda
 
M

Marshall Barton

I do not beliece that a button is necessary.

I do not understand what you are saying about "the
checkbox's Control Source is tied to the ID field, or what
you are trying to accomplish by trying to set it's value.
--
Marsh
MVP [MS Access]

Thanks for the direction! I've incorporated the example into my form, it's a
little od, because there is a command button on top of the checkbox for
selecting a record, and the button controls checking and unchecking the box.

So I'm running into a couple of issues. One is that the checkbox's Control
Source is tied to the ID field (in my case [Animal ID]), so I keep getting
errors that say "Control cannot be edited, it's bound to the expression
'IsChecked([Animal ID])"

I have not found a good reference on what tying the control source to
IsChecked([field]) does- so I'm having problems troubleshooting.

Also, the example begins with the records unchecked, and I would like all
the records in my "Preview" checked- but if I run a command to check the
checkbox when the filter is applied, I get "You can't assign a value to the
object" - which is probably for the same reason.

Could you help me understand what tying this control source to the checkbox
is doing?

Marshall Barton said:
You would have to create a field in the form's record source
table. BUT, that won't work if you ever allow more than a
single user. To allow more than one user, you would need a
local, parallel table with the PK field of the original
table along with the YesNo field.

A different approach that does not use a table is Albert
Kallal's clever trick in his Multi Select sample at:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top