Microsoft Access Modules and VBA tutorials
Topics: The Type of Recordset Objects, Creating a Recordset Object, Characteristics of a Record Set, Opening a Record Set, Record Navigation in a Record Set, The Fields of a Recordset.
Related Tutorials
Operations on Record Sets
This MS-Access tutorial will teaches you about operations on record set.
Exploring Multiple Active Record Sets with MS Access
This tutorial explains how to access multiple recordsets from a single connection to SQL Server 2005 in Microsoft Access. We will also explore the properties of the recordsets. TOC: Exploring Multiple Active Record Sets with MS Access; Connecting to SQL 2005 using ADO; Executing SQL Queries on the Open Connection; Interleaving Data from Two Recordsets.
Access/VBA Tutorials
When a record is deleted from a form's recordset, then bookmarks are used to go to another record more than 262 records away from the deleted one, it appears as though the record with the correct ID is being edited, but in fact a record offset positively from that one number of records deleted) is actually edited. What you see is NOT what you get - the wrong record is edited.
Save a record
Microsoft Access automatically saves the record you are adding or editing as soon as you move the insertion point to a different record, or close the form or you are working on...
Macro Conditional If Record Not Found
I've been trying to make a macro conditional that attempts to find a record in query X and if no such record exists, to go to form Y, however, if a record does exist, go to form Z. If I only want form X opened if such a record does not exist, wouldn't I use a conditional to cross reference the entry on a form "A" with the selected field after the FINDRECORD?? Is there an easier way?
Refreshing data on a child one-many form
I have a one to many relationship on a form/subform. I have buttons on the subform that basically will automatically add a new record to the table the subform is based on. I am using the sql "insert" clause to add the record - which it is dong just fine. However, I have tried the .refresh and .requery commands and neither seem to be able to display the new record automatically in the list. I have to exit the screen and come back in before the new record is displayed. WHat method can I use to cause the new record to be displayed on the child form right away?
Introduction to Data Analysis
After creating one or more tables in a database and populating it (them) with values, one of the next steps you would take is to examine or analyze the values in the database. Analyzing the values in a table is also referred to as querying. TOC: Querying a Database, Introduction to SQL, The Query Wizard, Query Design, Accessing the SQL Code of a Query, Removing a Column From a Query, Replacing and Moving a Column, A Query or a SQL Statement as a Record Source.
How to: Determine Whether The Current Record is a New Record In a Form
Learn how to use the NewRecord property to determine if the current record is a new record.
Microsoft Access Multi-User Application Record Locking
Record locking occurs in two environments, the Microsoft Access Interface and the ADO Recordset Object. We have already established that record locking is in effect mostly in network shares. But what is record locking exactly? Well it is a mechanism that locks records when they are being edited by a particular user so that other users cannot edit them.
Outputting one HTML file per record in an Access database
There are several ways to make your Access data available on the Web. Usually, Access displays more than one record per Web page. For example, when you create a data access page, you can browse and modify all records in the record set from one Web page. Or, when you output a datasheet to an HTML or XML file, all the records are formatted as one HTML table. However, there are times when you want to output one HTML file per record. Learn: Why output one HTML file per record in an Access database? How many ways in Access can I output one HTML file per record? Use a report to output one HTML file per record. Use the VBA PRINT statement to output one HTML file per record.
How to: Move Through a DAO Recordset
A Recordset object usually has a current position, most often at a record. When you refer to the fields in a Recordset, you obtain values from the record at the current position, which is known as the current record. However, the current position can also be immediately before the first record in a Recordset or immediately after the last record. In certain circumstances, the current position is undefined. Describes how to use the Move methods to navigate a recordset.
How to: Return a Random Record from a DAO Recordset
Microsoft Access does not have a built-in mechanism for returning a random record from a set of records. This topic describes a sample user-defined function that you can use to return a random record.
Update a text box to a value when a new record is created
In an Access 2003/XP/2000/97 form, I want to check when the user adds a new record (is there any relevant event?) so that I can load a default date value in a text box. I tried to go to a new record each time the form was loaded, but that resulted in numerous unwanted records. How can I avoid this?
Record selector symbols
To show the status of the current record in a form or datasheet, Microsoft Access displays the following symbols in the current record selector.
Delete a record using VBA code in Access
I've created a form and I want to delete the currently selected record. How do I delete the current record in the form?
How to: Display a Custom Dialog Box When the User Deletes a Record
When you select a record on a form and delete it, Access displays a dialog box asking the user to confirm the deletion of the record. Learn how to use the BeforeDelConfirm event procedure to display a custom dialog box when the user deletes a record.
How to: Synchronize a DAO Recordset's Record with a Form's Current Record
Learn how to synchronize a recordset's record with the form's current record.
Set the focus on the first field in a form whenever a record is viewed
In Access 2003/XP/2000/97, I have a control button to "Add a New Record" on a form. I realized that when I clicked on it, even though a new record comes up, the cursor does not go directly to the first field of data entry. How can I get the cursor to move to the first field on the form?
Print A Single Record from a Microsoft Access Form into a Report
You may, at times, wish to only print the record that you are currently displaying in your Microsoft Access form. This can be done directly from the Form's File: Print Option and choosing Print Range : Selected Record(s). However, forms are not really optimized to print out records and you may wish to present your data in a more user friendly approach.
Duplicate a record in Access
I've created a form in Access 2003/XP/2000/97 and I want to have a button on the form that duplicates the current record. What VBA code do I use to duplicate the current record in a form?
Forms/Subforms and Auto Seq numbers followup
In my sub-forms that use the increment number, how do I get the next new record to automatically show the next available number? What's happening now is that when I enter a new record, the increment is correct on that record. But, on the data entry form, the NEXT (blank) record shows the same increment number. I have stored the formula in the Default section of the control, and I have tried to set up a requery function on the form in several different areas to see which would update it. None of them seem to work quite right. The closest I've gotten is to enter a character in a new entry, then press ESC and the increment will then change to the correct number. I hope this makes sense. Thanks, and hope you have a great day.
linking 3 tables
I have attached a db.jpg ( a screen shot) of my MS Access Database. Here we have 3 tables: S_T,SI_T and SO_T. S_T is the main Tables, S_T primary key S_Id is used as foriegn key in SI_T as SI_Section_Id and PRimary key of SI_T table is SI_Id, also, the Primary key of SI_T is used as Foriegn key in Table SO_T as SO_Inspecs_id ,the Primary key of SO_T is SO_ID. I need a query that joins the three tables and displays 1 record of Each Record of Main Table S_T e.g if S_t has 1 record and it is used as PK at 2 records in SI_T then the result should only displays one record. We can say that multiple instances of Foriiegn keys should be ignored and only one record shoud be displayed.
Add a Record to a Table Using SQL
Adding a record to a table is a bit tricky. But the following will help you master this common database task.
Obtaining the ID of the record you just inserted
A common question I am asked is: "How do you obtain primary key (auto increment integer) of the record I just inserted?".
Report by Selecting Indv Record
This article explains how to select an individual MS Access record, and generate a report.
Introduction to Data Analysis
Data analysis provides the user with the ability to examine a database's records and the overall behavior of its objects. Data analysis is performed on tables, queries, and/or forms. There are two main aspects involved with data analysis: what you provide to the users and what the users may decide to do with data at their disposal. An intermediate to advanced user of Microsoft Access will know how to perform some, most, or all of the operations we will review. In some other cases, you may want to create objects such as forms and/or reports that isolate records instead of showing all records. Learn: Techniques of Sorting Records, Record Sorting on Tables and Forms, Record Filtering on Datasheet and Form Views, Records Filtering Using Selections, Filter By Exclusion, Filter By Form, Data Analysis With Operators, Advanced Filter By Selection, Data Analysis and Filtering by Comparison.
Assign default values from the last record
How to have form in a Microsoft Access database automatically offer to the values of the last record, to avoid typing similar data again.
Repeat the value from the previous record
In a field in a record, you can insert the value that is in the same field in the previous record.
Searching for a record based on a text box value in a form
There are times, when developing your Microsoft Access databases, that you may wish to allow your users to search for a record in the form that contains a certain value which will be entered into a textbox.
Locate specific records in a database
As your database grows, locating specific records will involve more than a quick glance at a datasheet. In this article, learn five ways to locate specific records based on your needs. What do you want to do? * Browse through all records * Go to a specific record * Search for a specific record * Filter to see a limited number of records * Create a query to find a specific record
Updating a Record
To change a record on a table using SQL, you use the following formula or SQL syntax ...
FindRecord Macro Action
You can use the FindRecord action to find the first instance of data that meets the criteria specified by the FindRecord arguments. This data can be in the current record, in a succeeding or prior record, or in the first record. You can find records in the active table datasheet, query datasheet, form datasheet, or form.
Sub-form Button Function Question
I have a relationship database with a primary group, family group, and company group. Each of these groups has a separate table and form with 4th table defining the relationship. We regularly add records to the database and to make it easy have created an add-record form based on the primary group. Within this form we have embedded sub forms for the family, company, and even the relationship groups. All of this works well with the exception of the "goto last record" button I have created for each of these forms. The button works if you open any single form on it's own, but none of them work when you open the "add new record" form. Darned if we can figure out why. There is no error message, it just doesn't go to the last record, or any record for that matter.
Data Entry and Record Maintenance
When performing data entry, you can expect the user to skip any column whose value is not available and move to the next. In some cases, you may required that the value of a column be specified before the user can move on. If you are creating the table in the Design View, to require that the user enter a value for a particular column, in the lower section of the window, use the Required Boolean property. By default, the value of the Required property is set to No, which means the user doesn't have to provide a value for the column in order to create the record. If you want to require the value, set this property to Yes. Topics: Details on Record Creation, Default Values, Finding a Value, Editing a Value, Record Maintenance.
Use a query as the record source for a form or report
You can use a query to supply data to a form or report. You can use a query when you create the form or report, or you can change an existing form or report by setting its Record Source property. When you set the Record Source property, you can either specify an existing query, or you can create a new query to use. If you use a query as the record source, you might not be able to edit the data. Before you use a query as your record source, you should consider whether you need to edit data. This article explains how to set the Record Source property for an existing form or report, and provides information about when you can and cannot edit query data. In this article: * Use an existing query as the record source of a form or report * Create a query as the record source of a form or report * Editing data from a query
GoToRecord Macro Action
You can use the GoToRecord action to make the specified record the current record in an open table, form, or query result set.
Using a Combo Box to Find Records
It is possible to use an unbound combo box in the header of a form as a means of record navigation. The idea is to select an entry from the drop-down list, and have Access take you to that record.
Has the record been printed?
How to determine whether a record in an Access database has been printed yet.
Return to the same record next time form is opened
When a form is opened, you may like to automatically load the most recently edited record.
Introduction to Data Fields
This tutorial will teaches you about introduction to data tables.
 
Categories