Could anyone help explain the following snippet of code? I'm not quite sure how it works. Thanks! - Public Counter As Integer
-
Private Sub Form_Load()
-
If Me.CurrentRecord > 0 Then
-
DoCmd.GoToRecord acActiveDataObject, "", acLast
-
Counter = Me.CurrentRecord
-
DoCmd.GoToRecord acActiveDataObject, "", acFirst
-
Else
-
MsgBox "There are no new issues.", vbOKOnly, "First Issues"
-
DoCmd.Close acForm, "frmEditReport", acSaveNo
-
Exit Sub
-
End If
-
End Sub
Software: Access 2003
Form: frmEditReport
Form's Record Source: qryEditReport
1 1348
Could anyone help explain the following snippet of code? I'm not quite sure how it works. Thanks! - Public Counter As Integer
-
Private Sub Form_Load()
-
If Me.CurrentRecord > 0 Then
-
DoCmd.GoToRecord acActiveDataObject, "", acLast
-
Counter = Me.CurrentRecord
-
DoCmd.GoToRecord acActiveDataObject, "", acFirst
-
Else
-
MsgBox "There are no new issues.", vbOKOnly, "First Issues"
-
DoCmd.Close acForm, "frmEditReport", acSaveNo
-
Exit Sub
-
End If
-
End Sub
Software: Access 2003
Form: frmEditReport
Form's Record Source: qryEditReport
It appears as though this code will: - Calculate the Total Number of Records in the Record Source of the displayed Form (by navigating to the Last Record) and placing its value in the Public Variable Counter (Lines 4 and 5). This will only be done if there is a Current Record.
- Reposition the Record Pointer to the first Record (Line 6).
- If there is no Current Record, display a Message Box and close frmEditReport (Lines 8 and 9).
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Az Tech |
last post by:
Hi people,
(Sorry for the somewhat long post).
I request some of the people on this group who have good experience
using object-orientation in the field, to please give some good ideas
for...
|
by: Michael B. |
last post by:
I was just thinking about this, specifically wondering if there's any
features that the C specification currently lacks, and which may be
included in some future standardization.
Of course, I...
|
by: rahul8143 |
last post by:
hello,
I am confused with following programs snippet code about how the
answer comes? statement/expression is evaluated?
1) int i=5;
i=i++*i++*i++*i++;
why the answer is not 5*6*7*8= 1680 but...
|
by: rodchar |
last post by:
Code Snippet 1
public class CustomerInfoCollection : IList
{
private ArrayList m_alCustomerInfo;
private DataSet m_ds;
public CustomerInfoCollection()
{
|
by: felixnielsen |
last post by:
Some might remember that i, not so long ago, started a treath or two
about a weird 3d labyrinth. I now have a working code, that i want to
share, hear comments, advice, ect., but first let me...
|
by: daokfella |
last post by:
Hi all,
I've created a code snippet in VS 2005 and saved it in the proper
snippet folder. When I right-click and select Insert Snippet, I
navigation to My Code Snippets and it shows my snippet....
|
by: Hardy |
last post by:
I created a code snippet which is for displaying file name,Line number
and function name in C#.NET project.
// <File>
sf.GetFileName()
// </File>
// <Line>
sf.GetFileLineNumber().ToString()...
|
by: steve.falzon |
last post by:
Hi
I've been searching high and low for this info but have been
unsuccessful so far. I wonder if anybody knows where I can get a
specification for the directives contained within the code...
|
by: tshad |
last post by:
I was watching a video that used a code snippet to create a property and
when you type "prop" tab tab, it would create the private variable as well
as the property definitions with the private...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |