Solved

Retrieve from access table.

Posted on 2000-03-21
6
155 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
Industry Leaders: 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!

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…
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…

717 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