Solved

DataBase records in a Combo Box

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

696 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