G
Guest
I have a combo box with an AfterUpdate Event:
Private Sub cbProfileID_AfterUpdate()
Dim strNewProfile As String
With Me.cbProfileID
' Capture the profile ID the user has selected or entered.
strNewProfile = .Value & vbNullString
If Len(strNewProfile) = 0 Then
' We've no idea what the user has in mind, so
' leave this alone.
Exit Sub
End If
' Is the user's entry an existing profile ID?
If .ListIndex = -1 Then
' This is not an existing profile ID.
' If we aren't on a new record, undo this entry,
' go to a new record, and re-enter it there.
If Not Me.NewRecord Then
.Undo
Me.Undo
RunCommand acCmdRecordsGoToNew
.Value = strNewProfile
' Me.cbProfileID = strNewProfile
End If
Else
' This is an existing profile ID.
' Undo the entry on this record and
' go to the record that was entered.
.Undo
Me.Undo
Me.Recordset.FindFirst "txtProfileID=""" & strNewProfile & """"
End If
End With
End Sub
This works fine, however, when Read-Only Users log into the database then
this function is "dead" for them.
Is there anything I can do to permit this function for Read-Only Users?
THANKS!
Private Sub cbProfileID_AfterUpdate()
Dim strNewProfile As String
With Me.cbProfileID
' Capture the profile ID the user has selected or entered.
strNewProfile = .Value & vbNullString
If Len(strNewProfile) = 0 Then
' We've no idea what the user has in mind, so
' leave this alone.
Exit Sub
End If
' Is the user's entry an existing profile ID?
If .ListIndex = -1 Then
' This is not an existing profile ID.
' If we aren't on a new record, undo this entry,
' go to a new record, and re-enter it there.
If Not Me.NewRecord Then
.Undo
Me.Undo
RunCommand acCmdRecordsGoToNew
.Value = strNewProfile
' Me.cbProfileID = strNewProfile
End If
Else
' This is an existing profile ID.
' Undo the entry on this record and
' go to the record that was entered.
.Undo
Me.Undo
Me.Recordset.FindFirst "txtProfileID=""" & strNewProfile & """"
End If
End With
End Sub
This works fine, however, when Read-Only Users log into the database then
this function is "dead" for them.
Is there anything I can do to permit this function for Read-Only Users?
THANKS!