Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Skip Record

Status
Not open for further replies.

Nitrous270

Technical User
Jul 27, 2002
67
0
0
US
I have a form with two entries that are somewhat hardcoded into the database and don't need to be edited or even seen. Is it possible to skip over these records based on a field on that form?

I mean I could do a check when the form updated and if true advance to the next record but if the user wanted to go backwards on the form they could never get past this record.

Thanks,
Nitrous270
 
This is the only way I know how.

Why dont you use a filter?

For example
Lets say your field displays a status of 1 (show field) and 2 (hide)
Private Sub Checkbox_Click()
If Me.Checkbox = True Then
Me.Form.Filter = "[FieldName] = '1'" 'only shows fields with status 1
Me.Form.FilterOn = True
Else
Me.Form.Filter = "" 'turns off filter
End If
This would give an option to turn on or off the filter. You could also just put the filter code in the Form Open section.
Private Sub Form_Load()
Me.Form.Filter = "[FieldName] = '1'"
Me.Form.FilterOn = True
End Sub

Hope this helps
S.
 
How about adding a "View" field to the table Type Yes/No Default Value True

Set the value in the records that you don't want to display to False and then add
Where View
into the Form's RecordSource ( Eg "SELECT * FROM tblName WHERE View;" )

You then have the flexibility of showing on some forms, not showing on others and changing you mind at a later stage if need be.




'ope-that-'elps



G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top