G
georgezx9 via AccessMonster.com
Hi all tahsnks for the snippets of advice, at last I have got my picklist
based on contents of previous pick list sorted. Problem I now have is that I
am not storing the contents of second picklist in the field and it is lost
every time..
Private Sub countryctl_AfterUpdate()
Me.Countyctl.RowSource = "SELECT county,county_id FROM" & _
" bikemeets_county WHERE bikemeets_county.Country_ID = " & Me.countryctl & _
" ORDER BY bikemeets_county.county"
Me.Countyctl = Me.Countyctl.ItemData(0)
End Sub
The above shows say the english counties in the countyctl picklist, if
england is selected from picklist called countryctl
note that I selecting two fields county and county_id. ID is a number used
for the relation unique to each county name. The countyctl shows the
countyname, column 1.
However the countyctl is unbound, if I bind it to the correct field in the
table, I get error must have a related item in the related table
I thought I could just add an on lost focus event that saves the Countyctl to
the correct table field, but how do I get access to it, it is column 2 I need
in the select statement above.
i.e. [bikemeets].[bikemeets].[County_ID] = Me.Countyctl - but I need column 2
Does this ever get easier!!!
Thanks in advance
GY
based on contents of previous pick list sorted. Problem I now have is that I
am not storing the contents of second picklist in the field and it is lost
every time..
Private Sub countryctl_AfterUpdate()
Me.Countyctl.RowSource = "SELECT county,county_id FROM" & _
" bikemeets_county WHERE bikemeets_county.Country_ID = " & Me.countryctl & _
" ORDER BY bikemeets_county.county"
Me.Countyctl = Me.Countyctl.ItemData(0)
End Sub
The above shows say the english counties in the countyctl picklist, if
england is selected from picklist called countryctl
note that I selecting two fields county and county_id. ID is a number used
for the relation unique to each county name. The countyctl shows the
countyname, column 1.
However the countyctl is unbound, if I bind it to the correct field in the
table, I get error must have a related item in the related table
I thought I could just add an on lost focus event that saves the Countyctl to
the correct table field, but how do I get access to it, it is column 2 I need
in the select statement above.
i.e. [bikemeets].[bikemeets].[County_ID] = Me.Countyctl - but I need column 2
Does this ever get easier!!!
Thanks in advance
GY