Solved

Flag selected records

Posted on 2011-03-14
7
283 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

770 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