By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,568 Members | 1,688 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,568 IT Pros & Developers. It's quick & easy.

Combos with Tens of Thousands of Records

P: n/a
I'm trying to reproduce this example by Allen Browne, available on his
website (excellent resource, BTW) to work. Available at
http://members.iinet.net.au/~allenbrowne/ser-32.html

The piece of code that's giving me problems is:
***************
Private Sub Suburb_AfterUpdate()
Dim cbo As ComboBox
Set cbo = Me.Suburb
If Not IsNull(cbo.Value) Then
If cbo.Value = cbo.Column(0) Then
If Len(cbo.Column(1)) > 0 Then
Me.State = cbo.Column(1)**********
End If
If Len(cbo.Column(2)) > 0 Then
Me.Postcode = cbo.Column(2)**********
End If
Else
Me.Postcode = Null**********
End If
End If
Set cbo = Nothing
End Sub
***************

Specifically, Access doesn't like Me.State or Me.Postcode. I get:

Compile error:
Method or data member not found

I'm probably being thick, but I've been fiddling and Googling for a couple
of hours to no avail.

Thanks for any hints.

Regards,

Robin
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Robin S. wrote:
I'm trying to reproduce this example by Allen Browne, available on his
website (excellent resource, BTW) to work. Available at
http://members.iinet.net.au/~allenbrowne/ser-32.html

The piece of code that's giving me problems is:
***************
Private Sub Suburb_AfterUpdate()
Dim cbo As ComboBox
Set cbo = Me.Suburb
If Not IsNull(cbo.Value) Then
If cbo.Value = cbo.Column(0) Then
If Len(cbo.Column(1)) > 0 Then
Me.State = cbo.Column(1)**********
End If
If Len(cbo.Column(2)) > 0 Then
Me.Postcode = cbo.Column(2)**********
End If
Else
Me.Postcode = Null**********
End If
End If
Set cbo = Nothing
End Sub
***************

Specifically, Access doesn't like Me.State or Me.Postcode. I get:

Compile error:
Method or data member not found

I'm probably being thick, but I've been fiddling and Googling for a
couple of hours to no avail.


For Me.State and Me.PostCode to work you need to have Controls on the form named
"State" and "PostCode" respectively OR fields in the underlying RecordSet with
such names. Do you?

If you have no such controls, but do have such fields, try using Me!State and
Me!PostCode instead. Access sometimes doesn't find field names with the dot but
will with the bang. This usually suggests a corruption of the form.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a

"Rick Brandt" <ri*********@hotmail.com> wrote in message
news:36*************@individual.net...

For Me.State and Me.PostCode to work you need to have Controls on the form
named "State" and "PostCode" respectively OR fields in the underlying
RecordSet with such names. Do you?

If you have no such controls, but do have such fields, try using Me!State
and Me!PostCode instead. Access sometimes doesn't find field names with
the dot but will with the bang. This usually suggests a corruption of the
form.


Rick,

It looks like my problem was in fact my misunderstanding of Allen's example.

I placed some text boxes on the form with the names State and Postcode and
of course it worked.

Thanks for your quick response.

Regards,

Robin
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.