?
Solved

DataBase records in a Combo Box

Posted on 1998-07-20
4
Medium Priority
?
154 Views
Last Modified: 2010-05-03
I want to allow the user to view and select Access database records in a combo or list box.  Upon selecting a record, bring up another form with more fields for the selected record. I already have a form that allows the user to view the records, but in textboxes, not a list, or in table form.

Thanks for your efforts,
hubermar
0
Comment
Question by:hubermar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 200 total points
ID: 1466265
hubermar,
1. get a datacontrol, set the databasename and recordSource
2. Get a DOCombo(or DBList), set the Rowsource to the datacontrol and the listField to the field you want to have the list,
3. Get a 2nd datacontrol which connect all your text box to show the record (like the one in your 2nd form), set the database record, and set the recordsource to a SQL statement like "Select * from yourtable where yourListField = '" & DBCombo1.Text & "'" ;
4. In the DBCombo's Change event, refresh datacontrol2.

Let me know if you have problems.
Regards
Dalin
0
 

Author Comment

by:hubermar
ID: 1466266
how do i put a second datacontrol on the form?  I used the form builder for the first one.

I guess that this is above my head.  I'll keep trying...

thanks,
hubermar
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1466267
hubermar,
In your toolbox, there is a control called a data control, (just move your mouse over and the tooltip will show "Data". Click on it and then drop one in your form, just like you do with textbox or lable... It shoul automatically name it data2 (since you already have data1).

Let me know if I can be further help. Just add commends to the question. Don't warry, every one has a learning process. I have been there before.
Regards
Dalin
0
 

Author Comment

by:hubermar
ID: 1466268
Dalin,

I'm with you till we get to the query.  Do i create the query in ACCESS or use the VisData? I can see that we need to stick a variable in the query, but i don't know how to do that.

Select * from dredge where Name:  =  DBCombo2.Text ;

Syntax must be wrong...

I do understand where you are going with this.  Makes plenty sense, but the variables are killing me.


Thanks,
hubermar

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question