Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

Database fields

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
mi5
Asked:
mi5
  • 2
  • 2
1 Solution
 
TimCotteeHead of Software ServicesCommented:
Data1.Recordset!<FieldName> where <fieldName> is the name of your field.
0
 
abaldwinCommented:
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
 
mi5Author Commented:
Is there any easy way of finding out how many records and fields there are in the table?
0
 
TimCotteeHead of Software ServicesCommented:
Number of records  = Data1.Recordset.RecordCount
Number Of fields =
Data1.Recordset.Fields.Count
0
 
mi5Author Commented:
Is there any easy way of finding out how many records and fields there are in the table?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now