Question How to browse a subset of records

Flaviramulus

New member
Local time
Today, 02:44
Joined
Jan 4, 2017
Messages
3
Hi, I have searched these forums and the web, but couldn’t find an answer to my problem.
I am using access 2016 for inventory management for a distillery. I have my raw materials in a table, and when a particular raw material is empty, a YES/No field called "empty", in this table is set to true. (This is done in a form)
I need to have all the records of empty raw materials in the db, due to regulations.
I have a form which is used for browsing through the raw material records, and I am using the buttons with embedded GOtoRecord macro for jumping to the next record.
As time goes on, the number of empty records has become a nuisance, and I would like to change the embedded macro for one that goes to the next record that does not have "empty" set to true. Is there any way to do this?
 
Edit the data source of the form to a query and just select records that are not listed as empty.
 
Thanks for your suggestion Tieval. Based on my original question this is a good solution. What I forgot to mention, is that the form which is used for browsing the raw materials records, also is used to make changes to the records in the case of typing errors etc, that always occurs with user input. If I changed the data source from table to query, I couldn’t edit the data.
 
Show the SQL string of the query.
 
Change [Embedded Macro] to [Event Procedure]
Click the elipsis (...)

Paste

Code:
With Me.Recordset
    .FindNext "[empty]=false"
    If .NoMatch And Not .BOF Then
        If MsgBox("No match, start from beginning?", vbYesNo) = vbYes Then
            .MoveFirst
            .FindNext "[empty]=false"
        End If
    End If
End With
 
Last edited:
why do you think you can't edit a from bound to a query?
 

Users who are viewing this thread

Back
Top Bottom