Save selection

  • Thread starter Thread starter Darrell Childress
  • Start date Start date
D

Darrell Childress

I have a continuous form with an Expedite field (it's a Yes/No
checkbox). I have a report based on a query that includes all records
where the Expedite field is checked (=-1). On the form, the user will
put a check in the records that s/he wants to be included in a report.
At the top of the form, in the header, I put a button to preview the
report. However, the last record that I check is not included in the
report until I click out of that record and into another. I guess what
I'm saying is the update (making the Expedite field "Yes") doesn't take
until I click out of that record. How can I fix this?
Thanks,
Darrell Childress
 
The last record has not been saved yet when you click the button.

Add this line to the code in the Event Procedure:
RunCommand acCmdSaveRecord
 
Perfect...thank you very much!

By the way, is there another, easier way to do this? I need a form where
the user can select certain items from a list and run a query based on
those items. What I am having to do is create a new field with a
checkbox. Once the operation is performed, I am creating a button that
runs an update query to reset all checkboxes to off.
Darrell
 
The Yes/No field is the simplest way to select mulitiple records from a
continuous form.

It's very easy to create a button that unselects them all again. Its Click
event procedure would be something like this:
Dim strSql As String
RunCommand acCmdSaveRecord
strSQL = "UPDATE Table1 SET IsPicked = False WHERE IsPicked = True;"
dbEngine(0)(0).Execute strSql, dbFailOnError

If the target is a report (not a query), and there are not too many records,
then it is possible to use a multi-select list box for the selection
process. Details in this article:
Use a multi-select list box to filter a report
at:
http://members.iinet.net.au/~allenbrowne/ser-50.html
 
Back
Top