Solved

Flag selected records

Posted on 2011-03-14
7
278 Views
Last Modified: 2012-05-11
Is there some way that I could, in a continuous form, let the user set filters and then change a logical field (print) for all of the records that remain displayed/selected in the dataset?

I want to export all the selected records, but in a specific format.  I plan to append the selected records to a table and then export to an Excel file.
0
Comment
Question by:PTaylorM2
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 35130926

how are you setting the filter?

if you happened to build a filter and store it in a string variable, say strFilter, you can use that filter to update the logical field

currentdb.execute "update table set [logicalfield]=-1 where " & strFilter
0
 
LVL 77

Expert Comment

by:peter57r
ID: 35130954
If you want to select all the visible records there shold be no need for a flag.
WHat matters is how you are setting the filters?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35130956

You cannot select non-contiguous record in a continuous form.

For this reason, you may want to use a  Listbox for this:
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:PTaylorM2
ID: 35137013
My wishful  thinking was to allow the user to right-click and set filters however they wish, and then click a button to flag any records (set a binary field to "yes") for those still being displayed in the recordset.
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
ID: 35137154
place this in the click event of a button

with me.recordset
   do until .eof
      .edit
       !YesNoField=-1
       .update
       .movenext
  loop
end with
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35138141
Then can you please take a step back and explain what your ultimate goal is here?

Setting a filter, flagging records or both?
0
 

Author Closing Comment

by:PTaylorM2
ID: 35138841
I wanted to allow a user to drill down through a set of records by using multiple filters and then save the results of the inquiry by flagging the records with a binary field.  
One use would be to copy those records into another table (to control the output) and export them into an Excel file.

This solution works. Thanks.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now