Hi
I have a combo box that is built from the following sql
All I want to disdplay in the Combo box is the Forename and Surname.
But
I want to use the other fields to set some global variable
Heres the AfterUpdate
The problem is that when I set the combobox
ColumnCount value to 2 it won't pass the values from the fields.
I want to be able to pass the values but not display the scroll bars in the combobox so that the user can scroll around
Hope you can help
Thanks
Phil
I have a combo box that is built from the following sql
Code:
Private Sub grpUser_AfterUpdate()
On Error Resume Next
Dim strUser As String
Select Case grpUser.Value
Case 1
strUser = "DIRC"
Case 2
strUser = "BMAN"
Case 3
strUser = "BADM"
End Select
G_Level = strUser
cboUser.RowSource = "Select Surname, FirstName, Staffno, PWord, REGCode " & _
"FROM dbo_Master1 " & _
"WHERE ACLEVEL = '" & strUser & "'" & _
"ORDER BY ACLEVEL;"
Me.cboUser.Visible = True
Me.Box22.Visible = True
Me.Label23.Visible = True
Me.Label24.Visible = True
Me.txtPassword.SetFocus
End Sub
All I want to disdplay in the Combo box is the Forename and Surname.
But
I want to use the other fields to set some global variable
Heres the AfterUpdate
Code:
Private Sub cboUser_AfterUpdate()
G_Surname = Me.cboUser.Column(0)
G_Forename = Me.cboUser.Column(1)
G_AStaffNo = Me.cboUser.Column(2)
G_Password = Me.cboUser.Column(3)
G_Region = Me.cboUser.Column(4)
Select Case G_Level
Case "DIRC"
G_AStaffNo = "*"
G_Region = Me.cboUser.Column(4)
Case "BMAN"
G_AStaffNo = "*"
G_Region = Me.cboUser.Column(4)
Case "BADM"
G_AStaffNo = Me.cboUser.Column(2)
G_Region = "*"
End Select
Me.txtPassword.Visible = True
Me.txtPassword.SetFocus
The problem is that when I set the combobox
ColumnCount value to 2 it won't pass the values from the fields.
I want to be able to pass the values but not display the scroll bars in the combobox so that the user can scroll around
Hope you can help
Thanks
Phil