update subform instantly?

vivou

Registered User.
Local time
Today, 07:54
Joined
Dec 15, 2002
Messages
16
hi!
i have a form, with some buttons : a,b,c,d,e,f,....,z

and i have a sub form with people data.

i want the following:
when i press a button, i will refresh the subform with the people who their name begin by the pressed letter.
+ refresh instantly.

i try :


Private Sub Command22_Click()
Dim stLinkCriteria As String
stLinkCriteria = "People.Name LIKE 'A%'"


Me.PEOPLE.Filter = stLinkCriteria

Refresh
End Sub

but this is not working "Me.PEOPLE.Filter = stLinkCriteria" not legal ...

how can i do that???:confused:
 
Create an Option Group called frSelectLetter. Within that option group create a toggle button for each letter of the alphabet. Assign a number of 1-26 to each toggle button.

In the AfterUpdate event of the option Group, add this code:

Dim strFilter As String

Select Case Me.frSelectLetter

Case 1
strFilter = "NameofYourTableorquery.FieldNameYouAreSearching Like 'A*' "

Case 2
strFilter = "NameofYourTableorquery.FieldNameYouAreSearching Like 'B*' "

'etc etc - through the alphabet


Case Else
' do nothing


End Select

Me.Filter = strFilter
Me.FilterOn = True

end sub

HTH
Elana
 
problem

it seems to be the good way: i delete the subform, and now all is on the same form with he option group

but there is still a major problem, after go out of the case sentence, on the "Me.Filter = strFilter"
i get:
run time error 7752
cant apply the filter because all the records are locked"

why that?? i did not locked anything!

and in the run form i can see:
in the navigation control, 1 of 6 (filtered)
what the problem, doc ??:eek:
 

Users who are viewing this thread

Back
Top Bottom