Filtering through Records

  • Thread starter Afrosheen via AccessMonster.com
  • Start date
A

Afrosheen via AccessMonster.com

I found this program on this board for a filtered "Find" command:

Private Sub txtFind_AfterUpdate()
If Len(txtFind) > 0 Then
Me.Filter = "[lname] Like ""*" & txtFind & "*"""
Me.FilterOn = True
Else
Me.FilterOn = False
End If

End Sub

What it is doing is if it finds the record and I skip through to the next and
the next it doesn't stop at the last record. It wants to add a new record. Is
there a way of stopping this?

Thanks for the help
 
M

Marshall Barton

Afrosheen said:
I found this program on this board for a filtered "Find" command:

Private Sub txtFind_AfterUpdate()
If Len(txtFind) > 0 Then
Me.Filter = "[lname] Like ""*" & txtFind & "*"""
Me.FilterOn = True
Else
Me.FilterOn = False
End If

End Sub

What it is doing is if it finds the record and I skip through to the next and
the next it doesn't stop at the last record. It wants to add a new record. Is
there a way of stopping this?


If you do not want to be able to add new rcords, then set
the form's AllowAdditions property to No,
 
A

Afrosheen via AccessMonster.com

Thanks Marshall, I'll try that.


Marshall said:
I found this program on this board for a filtered "Find" command:
[quoted text clipped - 11 lines]
the next it doesn't stop at the last record. It wants to add a new record. Is
there a way of stopping this?

If you do not want to be able to add new rcords, then set
the form's AllowAdditions property to No,
 
A

Afrosheen via AccessMonster.com

I'm sorry, Do those statements go on the form or the text box?
I can't put them on the form because after I find the person they must be
able to edit information.

Thanks.
Thanks Marshall, I'll try that.
[quoted text clipped - 4 lines]
If you do not want to be able to add new rcords, then set
the form's AllowAdditions property to No,
 
M

Marshall Barton

What statements? AllowAdditions is a form property and I
thought you only needed to set it in the form's property
sheet.

I don't understand what you mean by needing to edit the
located records. AllowAdditions only prevents adding new
records, it has no effect on editing existing records.
--
Marsh
MVP [MS Access]

I'm sorry, Do those statements go on the form or the text box?
I can't put them on the form because after I find the person they must be
able to edit information.
Thanks Marshall, I'll try that.
I found this program on this board for a filtered "Find" command:
[quoted text clipped - 4 lines]
If you do not want to be able to add new rcords, then set
the form's AllowAdditions property to No,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top