Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Retrieve from access table.

Posted on 2000-03-21
6
Medium Priority
?
157 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 150 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Technology Partners: 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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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 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…
Suggested Courses

609 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