charcurley
Programmer
- Aug 16, 2001
- 29
I have been given a database to go over because of an error that keeps occuring after the installation of Windows 2000. This was written in Access 97 and works fine in Access 97. When you open it in Access 2000 or 2002 an error occurs and I think that the Module below may be the culprit. Basically here is what is suppose to happen and what is happening:
You click into a field on a form. If the field is null another form pops up with only a listbox and OK and Cancel buttons. You make your selection(s) and click ok. In Access 97 the info you selected writes to the field in the Initial Form. But in 2000 it will not, you have to close the Initial Form before you can close out the FrmPhraseLookup. Before I spend more time on this issue is there anyone out there that might be able to look at the module and know what is causing this?
Thanks for any help.
Charlene
Function ShowChosen() As String
Dim varPhrase As Variant
Dim strtemp As String
'-- for each of the items in the ItemsSelected collection
For Each varPhrase In Forms![FrmPhraseLookup].LstPhrasePicks.ItemsSelected()
'-- If not the first item, put a carriage return line feed
'-- in front of the item
If Len(strtemp) <> 0 Then
If InStr(1, ":;.", Mid$(strtemp, Len(strtemp), 1), 1) = 0 Then
strtemp = strtemp & ", "
Else
strtemp = strtemp & " "
End If
If Mid$(Forms![FrmPhraseLookup].LstPhrasePicks.Column(1, varPhrase), 1, 3) = "and" Then
strtemp = Mid$(strtemp, 1, Len(strtemp) - 2)
strtemp = strtemp & " "
End If
If Mid$(Forms![FrmPhraseLookup].LstPhrasePicks.Column(1, varPhrase), 1, 1) = "-" Then
If Mid$(strtemp, Len(strtemp) - 1, 1) = "," Then
strtemp = Mid$(strtemp, 1, Len(strtemp) - 2)
End If
strtemp = strtemp & Chr(13) & Chr(10)
End If
End If
'-- Grab the second column over of the current item
strtemp = strtemp & Forms![FrmPhraseLookup].LstPhrasePicks.Column(1, varPhrase)
Next varPhrase
'-- Assign the final string pass it back
If Len(strtemp) > 0 Then
If Mid$(strtemp, Len(strtemp), 1) <> "." Then
strtemp = strtemp & "."
End If
strtemp = UCase(Mid$(strtemp, 1, 1)) + Mid$(strtemp, 2, Len(strtemp) - 1)
End If
ShowChosen = strtemp
End Function
You click into a field on a form. If the field is null another form pops up with only a listbox and OK and Cancel buttons. You make your selection(s) and click ok. In Access 97 the info you selected writes to the field in the Initial Form. But in 2000 it will not, you have to close the Initial Form before you can close out the FrmPhraseLookup. Before I spend more time on this issue is there anyone out there that might be able to look at the module and know what is causing this?
Thanks for any help.
Charlene
Function ShowChosen() As String
Dim varPhrase As Variant
Dim strtemp As String
'-- for each of the items in the ItemsSelected collection
For Each varPhrase In Forms![FrmPhraseLookup].LstPhrasePicks.ItemsSelected()
'-- If not the first item, put a carriage return line feed
'-- in front of the item
If Len(strtemp) <> 0 Then
If InStr(1, ":;.", Mid$(strtemp, Len(strtemp), 1), 1) = 0 Then
strtemp = strtemp & ", "
Else
strtemp = strtemp & " "
End If
If Mid$(Forms![FrmPhraseLookup].LstPhrasePicks.Column(1, varPhrase), 1, 3) = "and" Then
strtemp = Mid$(strtemp, 1, Len(strtemp) - 2)
strtemp = strtemp & " "
End If
If Mid$(Forms![FrmPhraseLookup].LstPhrasePicks.Column(1, varPhrase), 1, 1) = "-" Then
If Mid$(strtemp, Len(strtemp) - 1, 1) = "," Then
strtemp = Mid$(strtemp, 1, Len(strtemp) - 2)
End If
strtemp = strtemp & Chr(13) & Chr(10)
End If
End If
'-- Grab the second column over of the current item
strtemp = strtemp & Forms![FrmPhraseLookup].LstPhrasePicks.Column(1, varPhrase)
Next varPhrase
'-- Assign the final string pass it back
If Len(strtemp) > 0 Then
If Mid$(strtemp, Len(strtemp), 1) <> "." Then
strtemp = strtemp & "."
End If
strtemp = UCase(Mid$(strtemp, 1, 1)) + Mid$(strtemp, 2, Len(strtemp) - 1)
End If
ShowChosen = strtemp
End Function