Solved

Retrieve from access table.

Posted on 2000-03-21
6
154 Views
Last Modified: 2010-05-02
How can i retrive data from tables created in access.I can write data to the tables but reading from the tables gives me a headache!!I want the data to be displayed in a form on textboxes if possible.
All suggestions are welcome.

Thanks in advance.
0
Comment
Question by:onalenna
[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
  • 3
  • 2
6 Comments
 

Expert Comment

by:pgg
ID: 2639524
Example in DAO

Dim DB as database
Dim RS as recordset
  Set DB = opendatabase("the name and path of the database")
  Set RS = DB.OpenRecordset("Select * from TABLENAME")
  Do until Rs.Eof
     From1.List1.Additem  RS!Fieldname that you want to use
     RS.MoveNext
  Loop
  RS.Close
  Set RS = Nothing

 Comments
 
 Example of select statement:
   Select * from Customers where changedby =' & UserId & '"
   Select * from TABLENAME where FIELD = CRITERIA Order By FieldName




 
0
 
LVL 14

Accepted Solution

by:
wsh2 earned 50 total points
ID: 2642054
1. Add a Data Control to your form.. set its DataBase property to your Access mdb file.. and Set its RecordSource property to the table you want (a dropdown).

2. Add a Textbox for each Field. In each Textboxs property.. Set the Datasource Property to the Data Control you created in step 1 (a dropdown).. and set the DataField property to the Table field you want (a dropdown).

Voile you are done.. <smile>.

The data control will allow you to move from record to record.. and if you like, you can add code to your textbox events.

----------------------------------
pqq:
Shame on you for locking down this question.. as Onalenna writes: "All suggestions are welcome".. <smile>.
0
 

Expert Comment

by:pgg
ID: 2643487
Sorry, to quick !
/pgg
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 14

Expert Comment

by:wsh2
ID: 2643607
Apology accepted.. Well done pgg.. <smile>
0
 

Expert Comment

by:pgg
ID: 2643677
pgg changed the proposed answer to a comment
0
 

Author Comment

by:onalenna
ID: 2648272
Thanks very much wsh2.
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

Suggested Solutions

Title # Comments Views Activity
Updates not working for MS Windows 7 12 195
Run code from text file in vb 1 87
Exit a vb6 apps when a calling it apps closes 15 58
Dinamic report to Crosstab query 9 53
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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 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