Solved

DataBase records in a Combo Box

Posted on 1998-07-20
4
147 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
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now