Solved

DataBase records in a Combo Box

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Concatenate 2 userform comboboxes to a userform text box 4 56
Run code from text file in vb 1 56
VBA filters 2 50
Access query that references subform 5 43
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

910 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

21 Experts available now in Live!

Get 1:1 Help Now