Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox link to a TextBox 2

Status
Not open for further replies.

tyang01

Technical User
Joined
Feb 1, 2007
Messages
46
Location
US
I need help guys. I'm trying to develop a db that holds

What I'm trying to do is link a combobox which contains "application name" to a textbox "department" and have the text box filter which department the application supports.

There is just one column in the combobox so.
I've tried.

Private Sub txtDeptSupport_AfterUpdate()
me.DeptSupport=me.cboAppTitle.Column.(0)
End Sub

But it doesn't seem to work.

So if anyone has any suggestions. Thank You.
 
When you say 'doesn't work' what do you mean? Is DeptSupport bound?
 
DeptSupport field is bound to the textbox.
 
Ok, I'm lost. Please explain again. At the moment you are updating a field to something else after the user has updated it. Is that what you want? it could be confusing for the user.
 
What I wanted is when I select a application in the combobox for it to look for and update which department it is supporting inside the texbox. And I tried the code I found off google in the first post. But it didn't update the department which the application was made for.

I also tried in the change event
Select Apptitle.Application, DeptSupport.Application From Application Where ((DeptSupport.Application)=Forms!AppForm!cboAppTitle);

Thanks
 
Create an unbound textbox and set the Control Source to:

[tt]=cboAppTitle.Column(0)[/tt]

Is this something like you want?
 
Not exactly,

If I select Excel as the application it should find which department it is used for. Both of the Fields are in the same table.

Exa.

Application = Excel <--combobox

Depatment Supporting = Accounts Recievable <---textbox
 
Which column of the combo box holds the department? If the combo box does not hold the department, what is the name of the table?

Does each application only have a reference to one department?
 
Make yourc combobox have TWO columns....one the app the other the department supporting. Set the ColumnCount to 2 and the ColumnWidths to 1";0"

This will go ahead and create the "connection: between the app and department...no further lookup will be necessary. The columnwidth property will only "show" the app to the users.

Using the AfterUpdate event of the combobox, put:
Me.DeptSupport = Me.cboAppTitle.Column(1)

This will place the "hidden" department column value into the text box.

Sound about right???

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
The Table contains both application field and department field.

The combo box is only one column and only contains the applications. The table's name is Application.

And yes each application has only one referenced department.
 
You can go with mstrmage1768 suggestion, you can go with a combination of mstrmage1768 suggestion and a combobox, or you can use DLookUp:

[tt]=DlookUp("DeptSupport","Application","AppTitle='" & Me.cboAppTitle & "'")[/tt]

Or there abouts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top