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
Solved

DataBase records in a Combo Box

Posted on 1998-07-20
4
149 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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

839 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