Access 2003 default Dropdown control not compatible with Access 20

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

Guest

Hi,

We have developed an Access application using Access 2003. We have used the
dropdown control that is provided by default in Access 2003. The database is
in Access 2000 format. However when we open the database using Access 2000
some of the methods/properties are not supported.
Like
1. RemoveItem
2. AddItem

Has anyone encounterd this problem before? Is there any update or service
pack that we can run to get this to work. There are a lot of controls and it
is going to be difficult to change them to use a different control.

Thanks in advance and any help will be appreciated.
Shubham Gupta
 
Shubham Gupta said:
Hi,

We have developed an Access application using Access 2003. We have used
the
dropdown control that is provided by default in Access 2003. The database
is
in Access 2000 format. However when we open the database using Access 2000
some of the methods/properties are not supported.
Like
1. RemoveItem
2. AddItem

Has anyone encounterd this problem before? Is there any update or service
pack that we can run to get this to work. There are a lot of controls and
it
is going to be difficult to change them to use a different control.

You can upgrade the Access 2000 to Access 2003 -- Service Packs or updates
do not give you the features and functions of later versions. If you'd
rather, you could get a copy of Visual Studio Tools for Office 2003 and
provide the 2003 format with runtime support.

Larry Linson
Microsoft Access MVP
 
It would not be too difficult to write your own, Access 2000-compatible
versions of the AddItem and RemoveItem methods. A row source of type 'Value
List' is just a delimited string, so it is just a matter of string parsing,
chopping, and concatenation. Something like ...

Public Sub AddItem(ListControl As Control, NewValue As Variant)

Dim strWork As String

'should really raise a custom error, but this
'is just quick-and-dirty sample code ...
If ListControl.ControlType <> acComboBox _
And ListControl.ControlType <> acListBox Then
MsgBox "ListControl must be a combo box or a list box"
Exit Sub
End If

If ListControl.RowSourceType <> "Value List" Then
MsgBox "RowSourceType must be 'Value List'"
Exit Sub
End If

strWork = ListControl.RowSource
If Right$(strWork, 1) <> ";" Then
strWork = strWork & ";"
End If
strWork = strWork & NewValue
ListControl.RowSource = strWork
Debug.Print strWork

End Sub

Public Sub RemoveItem(ListControl As Control, NewValue As Variant)

'validation of control type and row source type skipped

Dim intPos As Integer
Dim strWork As String
Dim strLeft As String
Dim strRight As String

strWork = ListControl.RowSource
intPos = InStr(1, strWork, NewValue)
If intPos = 0 Then
Exit Sub
End If
strLeft = Left$(strWork, intPos - 1)
strRight = Mid$(strWork, intPos + Len(NewValue) + 1)
ListControl.RowSource = strLeft & strRight
Debug.Print ListControl.RowSource

End Sub
 
Hi Brendan,

This looks like a solution that would work for me. I am going to try and
implement it; however I have two columns in the dropdown. I was separating
them by a ";". What would I need to change in the Add Item method to support
multiple columns?

Thanks a lot,
Shubham
 
Back
Top