Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Database fields

Posted on 2000-05-09
5
Medium Priority
?
181 Views
Last Modified: 2010-05-02
If I have a data control on my form linked to an Access database (with a table selected in RecordSource) is it possible to get the contents of a field on the current record without linking another control to the data control?
0
Comment
Question by:mi5
  • 2
  • 2
5 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 2792853
Data1.Recordset!<FieldName> where <fieldName> is the name of your field.
0
 
LVL 4

Expert Comment

by:abaldwin
ID: 2792877
I take it you are talking about a vb form with a datacontrol that is bound.

Control type       Name
Datacontrol - datMyBoundControl
Text box - txtMyUnboundControl
First Data Field  - CompanyName


The following line will set the text box to contain the data in the Company name field

Either

txtMyUnboundControl.text = datMyBoundControl.Recordset.fields("CompanyName")

Or
txtMyUnboundControl.text = datMyBoundControl.Recordset.fields(0)

If you need more than that let me know.

Andy
0
 

Author Comment

by:mi5
ID: 2793087
Is there any easy way of finding out how many records and fields there are in the table?
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 200 total points
ID: 2793102
Number of records  = Data1.Recordset.RecordCount
Number Of fields =
Data1.Recordset.Fields.Count
0
 

Author Comment

by:mi5
ID: 2793103
Is there any easy way of finding out how many records and fields there are in the table?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
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…
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 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…

886 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