Hi again
Yes I believe that the code is in the correct place
Did the find exercise and yes it found it ????
Not sure what I have done wrong...
Bob
OK
The function that your code can't find is this function
Function ReloadSuburb(sSuburb As String)
Did you put the code for that function in the General Declarations
section of the form's module?
If you have done that, try this.
Open the find and replace dialog in the code window
Type
Function ReloadSuburb
into the find part, set it to search the current module and click
search.
Did you find that function in the general declarations section of the
code?
Maybe you have a simple spelling mistake and that is confusing access?
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Thanks Jeanette
But I am initially making sure that the example works and so I have a
table set up as instructed..............
but I get the error message??
Bob
Here is the code for ReloadSuburb.
You will see that it sets the row source for the combo where user
chooses a suburb (city).
The code below goes into the General declarations section of your
form module.
That means it goes at the top of the code page, just under
Option Compare Database
Option Explicit.
However you are not dealing with suburbs, you are using people's
names.
You need to make some changes to the code for ReloadSuburb so that
it loads your combo with people's name.
Perhaps you have already done this and called the function something
like
ReloadNames (sName As String)?
If so, in the current event for your form, instead of code which says
Call ReloadSuburb(Nz(Me.Suburb, ""))
You would put
Call ReloadNames(Nz(Me.[NameOfYourCombo], ""))
the code from Allen's website-------------
Step 1: Paste this into the General Declarations section of your
form?s module:
Dim sSuburbStub As String
Const conSuburbMin = 3
Function ReloadSuburb(sSuburb As String)
Dim sNewStub As String ' First chars of Suburb.Text
sNewStub = Nz(Left(sSuburb, conSuburbMin),"")
' If first n chars are the same as previously, do nothing.
If sNewStub <> sSuburbStub Then
If Len(sNewStub) < conSuburbMin Then
'Remove the RowSource
Me.Suburb.RowSource = "SELECT Suburb, State, Postcode FROM
Postcodes WHERE (False);"
sSuburbStub = ""
Else
'New RowSource
Me.Suburb.RowSource = "SELECT Suburb, State, Postcode FROM
Postcodes WHERE (Suburb Like """ & _
sNewStub & "*"") ORDER BY Suburb, State, Postcode;"
sSuburbStub = sNewStub
End If
End If
End Function
end Allen's code -----------
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Hi Jeanette
Thank you for pointing me in this direction.....looks idea
I have followed the instructions I believe but when I open the form
I get the following message
'ms Office Access can't find the object 'Call ReloadSuburb)Nz(Me.'
Any help in understanding this error message????
Bob
message You might be interested in this for Combos with 10's of thousands
of records
http://www.allenbrowne.com//ser-32.html
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Hi
Using ms Access 2007
I have alpha buttons on the bottom of the form to filter the
available records - based on surname.
If the number of records is still too large for several letters of
the alphabet, what is the easiest way to filter further - say on 2
or 3 letters of a surname?
Bob