R
RandyH
Thanks in advance for any help!
I have the following script for a field called DialUpAccess in my Microsoft
Access database. This is a combo box that can look up entered values
(repeating values) or should allow values that were not previously not in
the list to be added.
The properties of the combo box are listed below:
The Control Source is 'DialUpAccess'
The Row Source Type is 'Value List'
The Row Source has this, "NetOP";"PC Anywhere";"RAS"
Limit to list is 'No'
Auto Expand is 'Yes'
Enabled is 'Yes'
Locked is 'No'
The 'On Not in List' event procedure is listed below:
Private Sub ComboDialup_NotInList(NewData As String, Response As Integer)
'Adds a remote access type that is not in the list to the list, if the user
wishes to do so.
Dim strMessage As String
Dim intAnswer As Integer
strMessage = "'" & [NewData] & "' is currently not in your list. Do you wish
to add it?"
intAnswer = MsgBox(strMessage, vbOKCancel + vbQuestion)
If intAnswer = 1 Then
Set dbsVBA = CurrentDb
Set rstKeyWord = dbsVBA.OpenRecordset("Hardware")
rstKeyWord.AddNew
rstKeyWord!ComboDialup = NewData
rstKeyWord.Update
Response = acDataErrAdded
Else
Response = acDataErrDisplay
End If
End Sub
Does anyone know what my problem here is?
Thanks again, Randy
I have the following script for a field called DialUpAccess in my Microsoft
Access database. This is a combo box that can look up entered values
(repeating values) or should allow values that were not previously not in
the list to be added.
The properties of the combo box are listed below:
The Control Source is 'DialUpAccess'
The Row Source Type is 'Value List'
The Row Source has this, "NetOP";"PC Anywhere";"RAS"
Limit to list is 'No'
Auto Expand is 'Yes'
Enabled is 'Yes'
Locked is 'No'
The 'On Not in List' event procedure is listed below:
Private Sub ComboDialup_NotInList(NewData As String, Response As Integer)
'Adds a remote access type that is not in the list to the list, if the user
wishes to do so.
Dim strMessage As String
Dim intAnswer As Integer
strMessage = "'" & [NewData] & "' is currently not in your list. Do you wish
to add it?"
intAnswer = MsgBox(strMessage, vbOKCancel + vbQuestion)
If intAnswer = 1 Then
Set dbsVBA = CurrentDb
Set rstKeyWord = dbsVBA.OpenRecordset("Hardware")
rstKeyWord.AddNew
rstKeyWord!ComboDialup = NewData
rstKeyWord.Update
Response = acDataErrAdded
Else
Response = acDataErrDisplay
End If
End Sub
Does anyone know what my problem here is?
Thanks again, Randy