Silver_surfer
New member
- Local time
- Tomorrow, 04:49
- Joined
- Jan 29, 2020
- Messages
- 14
So I have a bound combobox, lets call this Assigned_to
It has 2 Column, EmployeeID and Nama, with first column as bound column, and hidden
What I want is, to autofill this combobox with Nama, which defined in strUser and then lock it when user open the form
I have tried to use .RowSource property to no avail
strUser is a Global Variable declared in Gvar Module
Which in turn get the value when a user is login to the database
I'm not familiar with VB, so every help is appreciated
It has 2 Column, EmployeeID and Nama, with first column as bound column, and hidden
What I want is, to autofill this combobox with Nama, which defined in strUser and then lock it when user open the form
I have tried to use .RowSource property to no avail
Code:
Me.Assigned_To.RowSource = "SELECT Nama FROM Employees WHERE EmployeeID= Dlookup("EmployeeID","Employee",[Nama]= & strUser)"
Me.Assigned_To.Locked = True
strUser is a Global Variable declared in Gvar Module
Code:
Option Compare Database
Global strUser As String
Global strRole As String
Which in turn get the value when a user is login to the database
Code:
strUser = DLookup("Nama", "Employees", "[UserName]='" & Me.cboUser.Value & "'")
I'm not familiar with VB, so every help is appreciated