I have frmMainMenu with the following two code
lines invoked on a button click...
2420 DoCmd.OpenForm "frmVehicleEntr yForm", A_NORMAL, , , A_ADD,
A_NORMAL
2440 DoCmd.GoToRecor d , , A_NEWREC
Is it generally considered good practice to issue the command
in line #2440 - intended to go to a new record in the vehicle entry
form - from frmMainMenu?
BTW, frmVehicleEntry Form's AllowEdits, AllowDeletions, AllowAdditions
and DataEntry property settings are all Yes. Does line #2440 even need
to be executed? 6 2554
"MLH" <CR**@NorthStat e.netwrote
>I have frmMainMenu with the following two code
lines invoked on a button click...
2420 DoCmd.OpenForm "frmVehicleEntr yForm", A_NORMAL, , , A_ADD,
A_NORMAL
2440 DoCmd.GoToRecor d , , A_NEWREC
Is it generally considered good practice to issue the command
in line #2440 - intended to go to a new record in the vehicle entry
form - from frmMainMenu?
You have specified in the OpenForm that it is to be opened in DataEntry mode
with the "A_ADD", which will override the actual Form properties, so there
is no need. In my not-so-humble opinion, redundant code is not "good
practice" unless it is _necessary_ to understanding for someone reading the
code, later.
However, code will continue to be executed, and, in my experience, the
OpenForm will have been completed, so that the GoToRecord will apply to the
newly opened form which will be the active form (that is, the one with the
Focus), even if you have not specified opening in Data Entry mode. You are
relying on the newly opened Form being the active Form, but that is the case
with the code you show, and will continue to be the case barring some design
change to Access itself.
All that said, the constants you are using are from Access 1.0 - Access 2.0
days, but the format of the DoCmd.OpenForm is of more recent vintage (in
Access 2.0, it would be DoCmd OpenForm...). But just in case, you _were_
asking about Access 2.0, I do not have that version readily available to
test, but think the answers are the same.
And, as an aside, for anyone asking about a version as far from being
current as Access 2.0 now is, it is a Really Good Idea to mention the
version. In fact, given all the "dramatic" changes in Access 2007, it is
probably more important than ever to identify the version that you are
using.
BTW, frmVehicleEntry Form's AllowEdits,
AllowDeletions, AllowAdditions and DataEntry
property settings are all Yes. Does line #2440
even need to be executed?
No, it does not, as discussed above.
Larry Linson
Microsoft Access MVP
On Tue, 08 May 2007 17:25:16 GMT, "Larry Linson"
<bo*****@localh ost.notwrote:
>"MLH" <CR**@NorthStat e.netwrote
>>I have frmMainMenu with the following two code lines invoked on a button click...
2420 DoCmd.OpenForm "frmVehicleEntr yForm", A_NORMAL, , , A_ADD, A_NORMAL 2440 DoCmd.GoToRecor d , , A_NEWREC
Is it generally considered good practice to issue the command in line #2440 - intended to go to a new record in the vehicle entry form - from frmMainMenu?
You have specified in the OpenForm that it is to be opened in DataEntry mode with the "A_ADD", which will override the actual Form properties, so there is no need. In my not-so-humble opinion, redundant code is not "good practice" unless it is _necessary_ to understanding for someone reading the code, later.
Thank-you.
> However, code will continue to be executed, and, in my experience, the OpenForm will have been completed, so that the GoToRecord will apply to the newly opened form which will be the active form (that is, the one with the Focus), even if you have not specified opening in Data Entry mode. You are relying on the newly opened Form being the active Form, but that is the case with the code you show, and will continue to be the case barring some design change to Access itself.
Thx for that. 'tis reassuring to know that's the case.
> All that said, the constants you are using are from Access 1.0 - Access 2.0 days, but the format of the DoCmd.OpenForm is of more recent vintage (in Access 2.0, it would be DoCmd OpenForm...). But just in case, you _were_ asking about Access 2.0, I do not have that version readily available to test, but think the answers are the same.
I agree with you on that. I've been getting by on a bit of luck.
?a_add
0
?acFormAdd
0
?acnormal
0
?a_normal
0
Where it gets unlucky is when I post code here with the old 1.0 and
2.0 constants in it. It can lend confusion to my question. Thx 4 the
'heads up' on that topic. Do you think I could go wrong with a global
search 'n replace in forms & modules substituting acFormAdd for A_Add?
> And, as an aside, for anyone asking about a version as far from being current as Access 2.0 now is, it is a Really Good Idea to mention the version. In fact, given all the "dramatic" changes in Access 2007, it is probably more important than ever to identify the version that you are using.
Absolutely. I failed to mention that I was working in A97. And using
1.0 / 2.0 references therein - well, that was just more crumming icing
on the cake.
>
BTW, frmVehicleEntry Form's AllowEdits,
AllowDeletions, AllowAdditions and DataEntry
property settings are all Yes. Does line #2440
even need to be executed?
No, it does not, as discussed above.
Larry Linson
Microsoft Access MVP
Larry Linson wrote:
All that said, the constants you are using are from Access 1.0 - Access 2.0
days, but the format of the DoCmd.OpenForm is of more recent vintage (in
Access 2.0, it would be DoCmd OpenForm...).
Does the guy even realize that intellisense will prompt you for the
correct constants?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
"MLH" <CR**@NorthStat e.netwrote
. . . Do you think I could go wrong with a global
search 'n replace in forms & modules substituting
acFormAdd for A_Add?
To me, the meanings are obvious, even with the Access 2.0 constants. I
probably wouldn't bother to change them, as long as Access supports them for
backward compatibility.
I'd certainly use the current constants when I write a new statement, and,
as Tim Marshall pointed out, Intellisense will show you the options. But, of
course, you don't get that "assistance " when you convert older code to the
current version, as you apparently did from Access 2.0 to Access 97.
And, yes, if you use a mixture of old and new formats, there are some who
might complain about "consistenc y", but, as long as it doesn't affect the
readability of the code, I wouldn't worry.
Larry Linson
Microsoft Access MVP
>>And, as an aside, for anyone asking about a version as far from being current as Access 2.0 now is, it is a Really Good Idea to mention the version. In fact, given all the "dramatic" changes in Access 2007, it is probably more important than ever to identify the version that you are using.
Absolutely. I failed to mention that I was working in A97. And using
1.0 / 2.0 references therein - well, that was just more crumming icing
on the cake.
>>
BTW, frmVehicleEntry Form's AllowEdits,
AllowDeletions, AllowAdditions and DataEntry
property settings are all Yes. Does line #2440
even need to be executed?
No, it does not, as discussed above.
Larry Linson Microsoft Access MVP
All good suggestions. Thanks.
> To me, the meanings are obvious, even with the Access 2.0 constants. I probably wouldn't bother to change them, as long as Access supports them for backward compatibility.
I'd certainly use the current constants when I write a new statement, and, as Tim Marshall pointed out, Intellisense will show you the options. But, of course, you don't get that "assistance " when you convert older code to the current version, as you apparently did from Access 2.0 to Access 97.
And, yes, if you use a mixture of old and new formats, there are some who might complain about "consistenc y", but, as long as it doesn't affect the readability of the code, I wouldn't worry.
Yep, the guy realizes that. But the guy
doesn't always follow good advice because
he's a stubborn old fart insistent on learning
things the hard way. (sorry) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: matty |
last post by:
Go away for a few days and you miss it all... A few opinions...
Programming is a craft more than an art (software engineering, not
black magic) and as such, is about writing code that works, first
and foremost. If it works well, even better. The same goes for
ease of maintenance, memory footprint, speed, etc, etc. Most of the
time, people are writing code for a use in the *real world*, and
not just as an academic exercise.
Look at...
|
by: Tony Marston |
last post by:
Several months ago I started a thread with the title "What is/is not
considered to be good OO programming" which started a long and
interesting discussion.
I have condensed the arguments into a single article which can be
viewed at
http://www.tonymarston.net/php-mysql/good-bad-oop.html
I fully expect this to be the start of another flame war, so sharpen
your knives and get stuck in!
|
by: Steven T. Hatton |
last post by:
Stroustrup's view on classes, for the most part, seems to be centered around
the notion of invariants. After a bit of adjusting to the use of yamt (yet
another math term) in computer science, I came to appreciate some of the
significance in what he is asserting. I believe a good example would be
the Riemann-Christoffel curvature tensor. In the 4-space of general
relativity, there are 256 components of this beast.
One approach to...
|
by: Peteroid |
last post by:
Why does reading a member of a std::map not considered const? For example:
class My_Class
{
int Get_Map_Value( int index ) const // ** error ** not considered
const!!!
{
return m_Map ; // note that m_Map is not changed, only read
from
}
|
by: trebor |
last post by:
I'm learning dotNet, although I first learned programming back in the
days when structured programming was all the rage. In both my books and
courses, I've seen something like this:
Public Class FormA
Inherits System.Windows.Forms.Form
Private Sub Button_Click(ByVal etc., etc.) Handles btnCalculate.Click
FormB.Textbox.Text = "some updated value"
End Sub
| |
by: tony |
last post by:
If you have any PHP scripts which will not work in the current releases
due to breaks in backwards compatibility then take a look at
http://www.tonymarston.net/php-mysql/bc-is-everything.html and see if
you agree with my opinion or not.
Tony Marston
http://www.tonymarston.net
|
by: Sameer |
last post by:
Hi friends,
I am beginner in C++. I am using g++ compiler. below is my code
which gives error as " invlid conversion from 'char' to 'const char*'
..Plz help me with this.
#include <iostream.h>
#include <string.h>
int low_range(char symbol) ;
int main(int argc, char **argv)
|
by: Bob Alston |
last post by:
Is it considered best practice to distribute FE databases as MDEs rather
than MDBs? Without flaming me for asking the question, could someone
please enumerate the key advantages?
Also I like to provide my users a mini report writer where the report
specs are stored as local data files. Can I do this in an MDE - e.g.
have local data files for the report writer spec but no queries, forms
or report changes?
Thanks.
|
by: Harry George |
last post by:
....at least around here.
I run a corporate Open Source Software Toolkit, which makes hundreds
of libraries and apps available to thousands of technical employees.
The rules are that a) a very few authorized downloaders obtain
tarballs and put them in a depot and b) other users get tarballs from
the depot and build from source.
Historically, python packages played well in this context. Install
was a simple download, untar, setup.py...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |