Combo Boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a combo box to generate the respective Pcode and Zone when the
Suburb is selected. The Postcode works fine, but the zone does not generate.
The 'After Update' Event procedure is as follows:

Private Sub Suburb_AfterUpdate()
Me.Pcode = Me.Suburb.Column(1)
Me.Zone = Me.Suburb.Column(1)
End Sub

Thanks for any help
 
What is the RowSource for the Suburb combo?

If the Zone is in the 3rd column, you would need to use:
Me.Zone = Me.Suburb.Column(2)
 
The Row Source Type is Table/Query
The Row Source is:
SELECT [POSTCODES].[SUBURB], [POSTCODES].[PCODE], [POSTCODES].[ZONE] FROM
[POSTCODES];
Have changed 2nd line to read:
Me.Zone = Me.Suburb.Column(2)

Still generates pcode but not zone. Would appreciate any further advice
Thank you
 
Column() is a zero-based property, i.e. the first column is zero, then 2nd
is 1, and the 3rd is Column(2).

So, it should work now.
I don't know what else to suggest.

Note that is won't work retrospectively for the existing records that have
already been assigned the wrong value.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Roger Bell said:
The Row Source Type is Table/Query
The Row Source is:
SELECT [POSTCODES].[SUBURB], [POSTCODES].[PCODE], [POSTCODES].[ZONE] FROM
[POSTCODES];
Have changed 2nd line to read:
Me.Zone = Me.Suburb.Column(2)

Still generates pcode but not zone. Would appreciate any further advice
Thank you
Allen Browne said:
What is the RowSource for the Suburb combo?

If the Zone is in the 3rd column, you would need to use:
Me.Zone = Me.Suburb.Column(2)
 
Back
Top