Re: Proper way to save a record
- From: "Albert D.Kallal" <PleaseNOOOsPAMmkallal@xxxxxxx>
- Date: Sun, 26 Jun 2005 19:08:08 -0600
> DoCmd.Save acForm, "FCycDoseVitalAmp"
The above command actually saves the form, and not the data. Clearly, you
don't need, nor want to save the form, so, dump the above line, it is NOT
needed.
> DoCmd.OpenForm "FCycDoseVitalAmp", acNormal
Why are you opening the form when it is already open? Again, you don't need
to open a form that is already open. So, dump the above line, it is NOT
needed.
> DoCmd.GoToRecord acDataForm, "FCycDoseVitalAmp", acNewRec
The above looks fine. Remember, if your code, or your user navigates to
another record, ms-access thoughtfully, and kindly saves the current data
for you
> DoCmd.GoToControl "course"
The above is also fine. I tend to prefer using the setfocus method of a
control., such as
course.SetFocus
I prefer the above since it implies that I am working with a control, and
you also get inteli-sense as you type it. Further, if you miss type the
name, and compile your code, you get a error. With the docmd, you only get
the error at RUNTIME, and so the compiler can't check your syntax for you.
As developer, you no doubt compile your code after any changes you make, and
thus using methods of control are checked at compile time. (setfocus is a
method of the control called course, and this is checked for you during
compile time).
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@xxxxxxx
http://www.members.shaw.ca/AlbertKallal
.
- Follow-Ups:
- Re: Proper way to save a record
- From: Pat Dools
- Re: Proper way to save a record
- References:
- Proper way to save a record
- From: Pat Dools
- Proper way to save a record
- Prev by Date: Proper way to save a record
- Next by Date: re:Auto update table on Form Load
- Previous by thread: Proper way to save a record
- Next by thread: Re: Proper way to save a record
- Index(es):
Relevant Pages
|