Strange Behaviour! (1 Viewer)

Seb

Registered User.
Local time
Today, 17:56
Joined
Jun 20, 2006
Messages
55
Here's one for you....

I have a drop down field that looks up 2 fields:

SELECT tblSuburbs.Suburb, tblShires.Shire FROM tblShires INNER JOIN tblSuburbs ON tblShires.ShireID=tblSuburbs.ShireID;

So I display field 1 (tblsuburbs.suburb) in the table and want to opulate another field with field 2 (tblshires.shire)

Here's what I put in the after_update:

Private Sub txtSuburb_AfterUpdate()
Me.txtShire.SetFocus
Me.txtShire.Text = Me.Suburb.Column(1)
End Sub

It works fine when I select a suburb the first time, but if I do it again, it just wont let you select anything in dropdown box 1 (tblsuburbs). almost like its locked.,......
 

RuralGuy

AWF VIP
Local time
Today, 01:56
Joined
Jul 2, 2005
Messages
13,826
I assume you have a typo. Try:
Code:
Private Sub txtSuburb_AfterUpdate()
'-- Me.txtShire.SetFocus --- DO NOT NEED
'-- Me.txtShire.Text = Me.Suburb.Column(1) --- DO NOT USE THE TEXT PROPERTY
Me.txtShire.Value = Me.txtSuburb.Column(1)
End Sub
If you use the .Value property then you do *not* need to move the focus. Did you really name a ComboBox txtSuburb rather than cboSuburb?
 

Seb

Registered User.
Local time
Today, 17:56
Joined
Jun 20, 2006
Messages
55
I did name it txtsuburb....I've gotten into the nasty habit of leaving the fieldnames that Access creates.....stupid & lazy...I know:D

Once again, thanks for your help
 

Users who are viewing this thread

Top Bottom