Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

locking combo box on access 2003 using -'combobox'

locking combo box on access 2003  using -'combobox'

i want to allow only the administrators to change/update a combobox with the following code, but it returns an error that the Recordset is empty

Private Sub cboFeeCat_BeforeUpdate(Cancel As Integer)

Dim rsUserName As Recordset
Dim varsql As String
Dim strUser As String
Dim crtUser As String

crtUser = Forms!xaV!txtUser

varsql = "Select * from xaUser Where UserInit = '" & crtUser & "';"
Debug.Print varsql

Set rsUserName = gcdb.OpenRecordset(varsql)
While Not rsUserName.EOF
strUser = CStr(Trim(rsUserName("UserInit")))

If strUser = "Admin" Then
cboFeeCat.Locked = False
cboFeeCat.Locked = True
End If

End Sub


asked Sep 7, 2015 by rajesh
0 votes

Related Hot Questions

Government Jobs Opening