| | |
Text Box populated by Combo Box
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Hello,
I have an access database with 3 tables. The table i am working on is tblemployee.
On a form i have a combo box with the employee numbers. Now, when a user chooses an employee number from the drop down box, i want the initial and name of that employee to appear in a non-editable text box.
I have been trying to get this to work but get errors.
I have put the above in the On Change Event in combo box "Employee".
Any help would be greatley apreaciated.
Thank you
I have an access database with 3 tables. The table i am working on is tblemployee.
On a form i have a combo box with the employee numbers. Now, when a user chooses an employee number from the drop down box, i want the initial and name of that employee to appear in a non-editable text box.
I have been trying to get this to work but get errors.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Employee_Change() If Employee.Text > 0 Then txtname.Visible = True Dim Sqltxt As String Sqltxt = "SELECT surname FROM TBLEmployee where [employee number] = " & Employee DoCmd.OpenQuery (Sqltxt) Else txtname.Visible = False End If End Sub
I have put the above in the On Change Event in combo box "Employee".
Any help would be greatley apreaciated.
Thank you
![]() |
Similar Threads
- SQL querry Combo Box Question (C#)
- DataGridView and combobox (VB.NET)
- regarding drpo down list (ASP.NET)
- Help Needed in editing Combo Box in VB 6.0 (Visual Basic 4 / 5 / 6)
- Highlighting only parts of text (Visual Basic 4 / 5 / 6)
- combo box problem... (PHP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Find Data in an Access Field from Excel Macro
- Next Thread: Win98 v. Access 2002
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





