BeforeUpdate doesn't always fire

L

.Len B

THE SETUP. (Access 2003)
I have a with several command buttons and a subform.
The subform has several textboxes and a combo box.

The (sub)Form_BeforeUpdate(Cancel As Integer) contains code
to validate the detail record. It handles
* required things
* warnings
* MsgBox accordingly

THE PROBLEM.
In addition to using the provided 'Save' button, users are able to
save incomplete/inappropriate detail records by exiting to the main
form (say by clicking cmdPrint or cmdClose). The BeforeUpdate code
doesn't fire and the record isn't validated and the user isn't warned.

I have found this which, although not exactly on topic, appears that
it might apply to this situation:-
When you close a form containing a subform, the subform
and its records are unloaded after the form. The Deactivate
event doesn't occur for subforms, so closing a main form
triggers a Deactivate event only for the main form. The
events for the controls, form, and subform occur in the
following order:
Events for the subform's controls(eg Exit & LostFocus)
Events for the form's control (incl the subform control itself)
Events for the form (eg Deactivate & Close)
Events for the subform

Am I correct saying that the subform BeforeUpdate does not fire in the
circumstances described?
Or is there a setting that controls this?
Or is there a way I can force a BeforeUpdate event?
Or is there a different event I can use?

As I cannot know which subform control might be active when the user
clicks outside the subform, I cannot invoke the code in an Exit event.
In any case, doing so would surely raise inappropriate MsgBox popups.
The form itself has no exit event and no other event seems applicable.
 
J

Jeanette Cunningham

The before update event for the subform will fire if the subform is dirty
and user clicks from the subform to the main form (assuming a bound
subform).
Note that as well as the subform having its own before update event, each
control like textbox, combo, listbox has a before update event as well.

To validate the data on the subform you must put your validation code in the
before update event for the subform.

If that is what you have already, please do a copy and paste of your code on
the before update event and post back here.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
L

.Len B

Hi Jeanette
I have posted the code below but it doesn't seem relevant. I can
set a breakpoint at say blnBadDate=False and it never gets there.

I open the app and then the main form. It opens with the subform
showing an empty detail. Cursor is in txtContactDate in subform
ready to create the new detail record. I enter a date and tab to
cboRoleID. Subform is now dirty because I have the editing pencil
symbol instead of the arrowhead in the record selector. Lets say
I do not choose a Role (so RoleID=0) and tab on to the memo field
to type comments. At any time after the subform is dirty I can
click on the mainform and the detail record is saved. The breakpoint
isn't reached, the Date or RoleID are never tested. The symbol
reverts to the arrowhead. I have specifically tested this by clicking
any of these on main form -
Close button (red X), cmdPrint, cmdHelp, cmdClose and cmdQuit.
cmdHelp & cmdPrint launch forms.


Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
Dim blnWarn As Boolean
Dim blnBadDate As Boolean

'Handle the required things first
blnBadDate = False
If IsNull(txtContactDate) Then blnBadDate = True
If (txtContactDate < 40100) Then blnBadDate = True 'before 14 Oct 09
If (txtContactDate > Now) Then blnBadDate = True
If blnBadDate Then
Cancel = True
strMsg = strMsg & "A valid contact date is required" & vbCrLf
End If
If IsNull(cboRoleID) Or (cboRoleID = 0) Or (cboRoleID > 8) Then
Cancel = True
strMsg = strMsg & "A Role is required" & vbCrLf
End If

'Now Handle Warnings
blnWarn = False
If Not Cancel Then
If Not chkOk2Save Then
strMsg = strMsg & conMustTick & vbCrLf
blnWarn = True
End If
End If

'Finish message and then display MsgBox
If Cancel Then
strMsg = strMsg & vbCrLf & "Correct the entry, or press <Esc> to
undo."
MsgBox strMsg
ElseIf blnWarn Then
strMsg = strMsg & vbCrLf & "REALLY?"
If MsgBox(strMsg, vbYesNo + vbDefaultButton2, "Are you sure?") <>
vbYes Then
Cancel = True
End If
End If

End Sub

--
Len
______________________________________________________
remove nothing for valid email address.
| The before update event for the subform will fire if the subform is
dirty
| and user clicks from the subform to the main form (assuming a bound
| subform).
| Note that as well as the subform having its own before update event,
each
| control like textbox, combo, listbox has a before update event as well.
|
| To validate the data on the subform you must put your validation code
in the
| before update event for the subform.
|
| If that is what you have already, please do a copy and paste of your
code on
| the before update event and post back here.
|
|
| Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
|
|
|
| | > THE SETUP. (Access 2003)
| > I have a with several command buttons and a subform.
| > The subform has several textboxes and a combo box.
| >
| > The (sub)Form_BeforeUpdate(Cancel As Integer) contains code
| > to validate the detail record. It handles
| > * required things
| > * warnings
| > * MsgBox accordingly
| >
| > THE PROBLEM.
| > In addition to using the provided 'Save' button, users are able to
| > save incomplete/inappropriate detail records by exiting to the main
| > form (say by clicking cmdPrint or cmdClose). The BeforeUpdate code
| > doesn't fire and the record isn't validated and the user isn't
warned.
| >
| > I have found this which, although not exactly on topic, appears that
| > it might apply to this situation:-
| > When you close a form containing a subform, the subform
| > and its records are unloaded after the form. The Deactivate
| > event doesn't occur for subforms, so closing a main form
| > triggers a Deactivate event only for the main form. The
| > events for the controls, form, and subform occur in the
| > following order:
| > Events for the subform's controls(eg Exit & LostFocus)
| > Events for the form's control (incl the subform control itself)
| > Events for the form (eg Deactivate & Close)
| > Events for the subform
| >
| > Am I correct saying that the subform BeforeUpdate does not fire in
the
| > circumstances described?
| > Or is there a setting that controls this?
| > Or is there a way I can force a BeforeUpdate event?
| > Or is there a different event I can use?
| >
| > As I cannot know which subform control might be active when the user
| > clicks outside the subform, I cannot invoke the code in an Exit
event.
| > In any case, doing so would surely raise inappropriate MsgBox popups.
| > The form itself has no exit event and no other event seems
applicable.
| >
| > --
| > Len
| > ______________________________________________________
| > remove nothing for valid email address.
| >
| >
|
|
 
L

.Len B

Purpose: Only to add NEW dated detail records. Do not display old detail
records.
A single main record is presented based on selection in the startup form.

RecordSources
Mainform: select query - selected fields, all records of one-side table,
tblChild.
Subform: many-side table itself. ChildID is PK of main and FK of sub.

MAIN FORM
All textboxes are locked and enabled. Not designed to add main records.
The
fields only provide context for adding detail records. Only cmd buttons
available.
No Record Selectors, Navigation Buttons or Scroll Bars.

SUBFORM
In addition to txtboxes and combos there is a chkOk2Save and cmdSave.
ScrollBar vert only, Record Selector yes, Nav buttons No.
Only two fields have defaults, LogonName and Now().
Link fields, both = ChildID

Answers to your checklist.
yes, one:many, main:sub
yes, link fields as stated above.
n/a. Can't add or edit main records.
Code posted is for subform_beforeupdate. Main has no BeforeUpdate code,
only Open etc.
Not in any way offended by its simplicity. I hope I've covered the bases
but something must
be amiss and I cannot find it so any help is appreciated and basics is a
good place to start.

--
Len
______________________________________________________
remove nothing for valid email address.
|I have not been able to produce the problem. I have found that if no
data
| have been entered into the main record (or if the only values are
defaults)
| the subform records are not saved, but even so the subform's Before
Update
| fires. A checklist (sorry if it seems simplistic, but as I said I
cannot
| produce the behavior you are seeing):
|
| Is the subform bound to a table that is related to the main form's
table?
| Are the subform control's Link Child and Link Master fields set
properly?
| Does it behave differently if you first enter a value into a bound
control on
| the main form?
| Is the code in the Before Update for the correct form?
|
| Len B wrote:
| >Hi Jeanette
| >I have posted the code below but it doesn't seem relevant. I can
| >set a breakpoint at say blnBadDate=False and it never gets there.
| >
| >I open the app and then the main form. It opens with the subform
| >showing an empty detail. Cursor is in txtContactDate in subform
| >ready to create the new detail record. I enter a date and tab to
| >cboRoleID. Subform is now dirty because I have the editing pencil
| >symbol instead of the arrowhead in the record selector. Lets say
| >I do not choose a Role (so RoleID=0) and tab on to the memo field
| >to type comments. At any time after the subform is dirty I can
| >click on the mainform and the detail record is saved. The breakpoint
| >isn't reached, the Date or RoleID are never tested. The symbol
| >reverts to the arrowhead. I have specifically tested this by clicking
| >any of these on main form -
| >Close button (red X), cmdPrint, cmdHelp, cmdClose and cmdQuit.
| >cmdHelp & cmdPrint launch forms.
| >
| >| The before update event for the subform will fire if the subform is
dirty
| >| and user clicks from the subform to the main form (assuming a bound
| >[quoted text clipped - 49 lines]
| >| > In any case, doing so would surely raise inappropriate MsgBox
popups.
| >| > The form itself has no exit event and no other event seems
applicable.
|
| --
|
|
 
D

Dirk Goldgar

.Len B said:
THE PROBLEM.
In addition to using the provided 'Save' button, users are able to
save incomplete/inappropriate detail records by exiting to the main
form (say by clicking cmdPrint or cmdClose). The BeforeUpdate code
doesn't fire and the record isn't validated and the user isn't warned.
[...]
Am I correct saying that the subform BeforeUpdate does not fire in the
circumstances described?

No. The subform's BeforeUpdate event should fire, and I have never heard of
a case where it did not, if correctly established.

Check to make sure that, in the property sheet of the form that is displayed
by the subform control, on the Event tab, the Before Update property is set
to "[Event Procedure]".
 
L

.Len B

The subform control on the main form has only Enter & Exit events.
The Exit event has only a DoEvents statement which I inserted just
to have somewhere to set a breakpoint. This event does fire.

The BeforUpdate event does have[Event Procedure] in the property
sheet. In fact the event does fire if I click on the cmdSave
within the subform but does not fire when leaving the subform
by another way, hence the wording of the subject line.

I just now tested by setting an exit event on one of the subform
controls and single stepping. I clicked on the cmdClose button of
the main form from within said control. OnExit fired, form closed,
incomplete detail record was saved without validation.

Just had a thought. I'll do a decompile / compile. Who knows?

--
Len
______________________________________________________
remove nothing for valid email address.
| | > THE PROBLEM.
| > In addition to using the provided 'Save' button, users are able to
| > save incomplete/inappropriate detail records by exiting to the main
| > form (say by clicking cmdPrint or cmdClose). The BeforeUpdate code
| > doesn't fire and the record isn't validated and the user isn't
warned.
| > [...]
| > Am I correct saying that the subform BeforeUpdate does not fire in
the
| > circumstances described?
|
| No. The subform's BeforeUpdate event should fire, and I have never
heard of
| a case where it did not, if correctly established.
|
| Check to make sure that, in the property sheet of the form that is
displayed
| by the subform control, on the Event tab, the Before Update property is
set
| to "[Event Procedure]".
|
| --
| Dirk Goldgar, MS Access MVP
| Access tips: www.datagnostics.com/tips.html
|
| (please reply to the newsgroup)
|
 
J

Jeanette Cunningham

Ah Hah! Use the before update event on the form that you put inside the
subform control.
This explains the strange results you were getting.
It's not the subform control where you validate data, it's the form
(subform) inside the subform control.
Sometimes both the subform and the subform control have the same name,
sometimes they don't.

By the way, it's best not to use exit events of controls to validate data -
causes problems and is best avoided.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
L

.Len B

I hadn't done a decompile before so I didn't know what to expect.
It appears similar to a Compact but when I open the VB code,
Clicking Debug shows Compile greyed out. Did the decompie work?
I did it twice.

In any case, I can still save an unvalidated detail record.

--
Len
______________________________________________________
remove nothing for valid email address.
| The subform control on the main form has only Enter & Exit events.
| The Exit event has only a DoEvents statement which I inserted just
| to have somewhere to set a breakpoint. This event does fire.
|
| The BeforUpdate event does have[Event Procedure] in the property
| sheet. In fact the event does fire if I click on the cmdSave
| within the subform but does not fire when leaving the subform
| by another way, hence the wording of the subject line.
|
| I just now tested by setting an exit event on one of the subform
| controls and single stepping. I clicked on the cmdClose button of
| the main form from within said control. OnExit fired, form closed,
| incomplete detail record was saved without validation.
|
| Just had a thought. I'll do a decompile / compile. Who knows?
|
| --
| Len
| ______________________________________________________
| remove nothing for valid email address.
| || || > THE PROBLEM.
|| > In addition to using the provided 'Save' button, users are able to
|| > save incomplete/inappropriate detail records by exiting to the main
|| > form (say by clicking cmdPrint or cmdClose). The BeforeUpdate code
|| > doesn't fire and the record isn't validated and the user isn't
| warned.
|| > [...]
|| > Am I correct saying that the subform BeforeUpdate does not fire in
| the
|| > circumstances described?
||
|| No. The subform's BeforeUpdate event should fire, and I have never
| heard of
|| a case where it did not, if correctly established.
||
|| Check to make sure that, in the property sheet of the form that is
| displayed
|| by the subform control, on the Event tab, the Before Update property
is
| set
|| to "[Event Procedure]".
||
|| --
|| Dirk Goldgar, MS Access MVP
|| Access tips: www.datagnostics.com/tips.html
||
|| (please reply to the newsgroup)
||
 
J

Jeanette Cunningham

When Compile is greyed out, all the code is compiled.
Once you start to edit some of the code, it will become uncompiled.
We usually click Debug | Compile every time we make a change to some code.
Then we always click Save to save the code.
Or you can do it in the reverse order.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


.Len B said:
I hadn't done a decompile before so I didn't know what to expect.
It appears similar to a Compact but when I open the VB code,
Clicking Debug shows Compile greyed out. Did the decompie work?
I did it twice.

In any case, I can still save an unvalidated detail record.

--
Len
______________________________________________________
remove nothing for valid email address.
| The subform control on the main form has only Enter & Exit events.
| The Exit event has only a DoEvents statement which I inserted just
| to have somewhere to set a breakpoint. This event does fire.
|
| The BeforUpdate event does have[Event Procedure] in the property
| sheet. In fact the event does fire if I click on the cmdSave
| within the subform but does not fire when leaving the subform
| by another way, hence the wording of the subject line.
|
| I just now tested by setting an exit event on one of the subform
| controls and single stepping. I clicked on the cmdClose button of
| the main form from within said control. OnExit fired, form closed,
| incomplete detail record was saved without validation.
|
| Just had a thought. I'll do a decompile / compile. Who knows?
|
| --
| Len
| ______________________________________________________
| remove nothing for valid email address.
| || || > THE PROBLEM.
|| > In addition to using the provided 'Save' button, users are able to
|| > save incomplete/inappropriate detail records by exiting to the main
|| > form (say by clicking cmdPrint or cmdClose). The BeforeUpdate code
|| > doesn't fire and the record isn't validated and the user isn't
| warned.
|| > [...]
|| > Am I correct saying that the subform BeforeUpdate does not fire in
| the
|| > circumstances described?
||
|| No. The subform's BeforeUpdate event should fire, and I have never
| heard of
|| a case where it did not, if correctly established.
||
|| Check to make sure that, in the property sheet of the form that is
| displayed
|| by the subform control, on the Event tab, the Before Update property
is
| set
|| to "[Event Procedure]".
||
|| --
|| Dirk Goldgar, MS Access MVP
|| Access tips: www.datagnostics.com/tips.html
||
|| (please reply to the newsgroup)
||
 
L

.Len B

I'm sorry Jeanette, you've lost me.
I have a main form, frmEnterNotes containing a subform control
called subfrmNote.

Inside the subfrmNote control is the subform called subfrmNoteNow.

subfrmNoteNow has the BeforeUpdate event where my posted validation
code lives. This code runs fine if I deliberately try to save the
detail record from within the subform using cmdSave. The record is
validated, saved and a new blank record is presented ready to enter
another note for this parent record.
It is only if I do not complete the subform normally that the problem
arises. Example, If I do anything outside the subform, the validation
code is somehow bypassed and the record is saved regardless of its
validity.

I think what you are saying is what I am doing. If not please say
what I should do. I only used the Exit event to provide somewhere
to put a DoEvents to set a breakpoint. That will go; no point to it.

--
Len
______________________________________________________
remove nothing for valid email address.
| Ah Hah! Use the before update event on the form that you put inside the
| subform control.
| This explains the strange results you were getting.
| It's not the subform control where you validate data, it's the form
| (subform) inside the subform control.
| Sometimes both the subform and the subform control have the same name,
| sometimes they don't.
|
| By the way, it's best not to use exit events of controls to validate
data -
| causes problems and is best avoided.
|
|
| Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
J

Jeanette Cunningham

I haven't come across this situation before.
If you set a break point on the subform's before update event in the code
window,
open the form in normal view,
do enough data entry to make the subform dirty and leave a required field
empty,
then click back on the main form,
does the code window open and allow you to step through the before update
event for the subform?


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
L

.Len B

I was surprised to see that the code was compiled after I had just
done a decompile. I wondered if it really did decompile.

--
Len
______________________________________________________
remove nothing for valid email address.
| When Compile is greyed out, all the code is compiled.
| Once you start to edit some of the code, it will become uncompiled.
| We usually click Debug | Compile every time we make a change to some
code.
| Then we always click Save to save the code.
| Or you can do it in the reverse order.
|
|
| Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
|
|
| | >I hadn't done a decompile before so I didn't know what to expect.
| > It appears similar to a Compact but when I open the VB code,
| > Clicking Debug shows Compile greyed out. Did the decompie work?
| > I did it twice.
| >
| > In any case, I can still save an unvalidated detail record.
| >
| > --
| > Len
| > ______________________________________________________
| > remove nothing for valid email address.
 
J

Jeanette Cunningham

Here is my decompile procedure.
However it is quite a long time since I have needed to do a decompile.

Here is my decompile procedure...
----start of decompile notes-----------
Open Access normally and Compact
Open with Decompile switch, then close
Open Access normally and compact again
Do a compile and save all
Compact again

All of the above on a *copy* of the file. If all goes well I replace the
original with the copy.

To decompile, I usually go via Start => Run...
"C:\Program Files\...etc...\MSACCESS.EXE" /decompile "C:\MyFolder\MyDb.mdb"
After this, compile again.
Steve Schapel

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"

A shortcut named something like Access Decompile can be created one time,
and then used to open any database. A database that you open with this
shortcut will be decompiled. For example, I have
three such shortcuts that I created for my PC, since I have Access 97, 2000
and 2002 loaded on my machine. I find this a lot easier than typing out the
path in the Start => Run... dialog each time.

Name:
Access 97 Decompile
Target:
"C:\Program Files\Microsoft Office 97\Office\msaccess.exe" /decompile

Name:
Access 2000 Decompile
Target:
"C:\Program Files\Microsoft Office 2000\Office\msaccess.exe" /decompile

Name:
Access 2002 Decompile
Target:
"C:\Program Files\Microsoft Office XP\Office10\msaccess.exe" /decompile


"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" /decompile
---------------------------
Tom

Thanks a lot, Tom, for this good suggestion. However, I personally don't
"type out the path in the Start => Run... dialog each time". I just select
the item I want from the combobox on the Start => Run dialog. :)

-- Steve Schapel, Microsoft Access MVP

I tend to use the Clear button on the Advanced tab of the Taskbar and Start
Menu Properties dialog fairly often. Call me paranoid, but I don't like to
leave snail trails that others can use to snoop around and see what I've
been up to. So, in my case, that would mean having to retype it each time
(or search for the correct version of msaccess.exe and drag-n-drop it onto
the Start => Run dialog.
Tom
--end of decompile notes-----------
 
L

.Len B

No. It doesn't fire.

I have breakpoints everywhere trying to figure where its going.
That's why I put the breakpoint in txtbox exit event. Code window
opens and I single step through.

The txtbox's exit fires, the subform control's exit event fires
and then the click event of a cmd button on the main form fires.
Record is now saved. Subform was certainly dirty.

I cannot click on a txtbox or cbo of main form. They are all locked.

I should say that no fields are 'required' at the table level;
validation intended to happen in BeforeUpdate code.
--
Len
______________________________________________________
remove nothing for valid email address.
|I haven't come across this situation before.
| If you set a break point on the subform's before update event in the
code
| window,
| open the form in normal view,
| do enough data entry to make the subform dirty and leave a required
field
| empty,
| then click back on the main form,
| does the code window open and allow you to step through the before
update
| event for the subform?
|
|
| Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
|
|
| | > I'm sorry Jeanette, you've lost me.
| > I have a main form, frmEnterNotes containing a subform control
| > called subfrmNote.
| >
| > Inside the subfrmNote control is the subform called subfrmNoteNow.
| >
| > subfrmNoteNow has the BeforeUpdate event where my posted validation
| > code lives. This code runs fine if I deliberately try to save the
| > detail record from within the subform using cmdSave. The record is
| > validated, saved and a new blank record is presented ready to enter
| > another note for this parent record.
| > It is only if I do not complete the subform normally that the problem
| > arises. Example, If I do anything outside the subform, the validation
| > code is somehow bypassed and the record is saved regardless of its
| > validity.
| >
| > I think what you are saying is what I am doing. If not please say
| > what I should do. I only used the Exit event to provide somewhere
| > to put a DoEvents to set a breakpoint. That will go; no point to it.
| >
| > --
| > Len
| > ______________________________________________________
| > remove nothing for valid email address.
message
| > | > | Ah Hah! Use the before update event on the form that you put inside
the
| > | subform control.
| > | This explains the strange results you were getting.
| > | It's not the subform control where you validate data, it's the form
| > | (subform) inside the subform control.
| > | Sometimes both the subform and the subform control have the same
name,
| > | sometimes they don't.
| > |
| > | By the way, it's best not to use exit events of controls to
validate
| > data -
| > | causes problems and is best avoided.
| > |
| > |
| > | Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
| >
| >
| >
|
|
 
L

.Len B

Thanks Jeanette
That's effectively what I did (twice).
I zipped the mdb(once).
Open normal and compact. Close.
Open cmd prompt and navigate to dir containing msaccess.exe
msaccess /decompile s:\...\my.mdb Close.
Open again. Compact. Compile menu option grey.

I've got 97, 2000, 2003 on my system.
Think I'll create some shortcuts too.
I'll put a copy of your notes in my reference files. Thanks.
--
Len
______________________________________________________
remove nothing for valid email address.
| Here is my decompile procedure.
| However it is quite a long time since I have needed to do a decompile.
|
| Here is my decompile procedure...
| ----start of decompile notes-----------
| Open Access normally and Compact
| Open with Decompile switch, then close
| Open Access normally and compact again
| Do a compile and save all
| Compact again
|
| All of the above on a *copy* of the file. If all goes well I replace
the
| original with the copy.
|
| To decompile, I usually go via Start => Run...
| "C:\Program Files\...etc...\MSACCESS.EXE" /decompile
"C:\MyFolder\MyDb.mdb"
| After this, compile again.
| Steve Schapel
|
| "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
|
| A shortcut named something like Access Decompile can be created one
time,
| and then used to open any database. A database that you open with this
| shortcut will be decompiled. For example, I have
| three such shortcuts that I created for my PC, since I have Access 97,
2000
| and 2002 loaded on my machine. I find this a lot easier than typing out
the
| path in the Start => Run... dialog each time.
|
| Name:
| Access 97 Decompile
| Target:
| "C:\Program Files\Microsoft Office 97\Office\msaccess.exe" /decompile
|
| Name:
| Access 2000 Decompile
| Target:
| "C:\Program Files\Microsoft Office 2000\Office\msaccess.exe" /decompile
|
| Name:
| Access 2002 Decompile
| Target:
| "C:\Program Files\Microsoft Office XP\Office10\msaccess.exe" /decompile
|
|
| "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" /decompile
| ---------------------------
| Tom
|
| Thanks a lot, Tom, for this good suggestion. However, I personally
don't
| "type out the path in the Start => Run... dialog each time". I just
select
| the item I want from the combobox on the Start => Run dialog. :)
|
| -- Steve Schapel, Microsoft Access MVP
|
| I tend to use the Clear button on the Advanced tab of the Taskbar and
Start
| Menu Properties dialog fairly often. Call me paranoid, but I don't like
to
| leave snail trails that others can use to snoop around and see what
I've
| been up to. So, in my case, that would mean having to retype it each
time
| (or search for the correct version of msaccess.exe and drag-n-drop it
onto
| the Start => Run dialog.
| Tom
| --end of decompile notes-----------
|
| | >I was surprised to see that the code was compiled after I had just
| > done a decompile. I wondered if it really did decompile.
| >
| > --
| > Len
| > ______________________________________________________
| > remove nothing for valid email address.
message
| > | > | When Compile is greyed out, all the code is compiled.
| > | Once you start to edit some of the code, it will become uncompiled.
| > | We usually click Debug | Compile every time we make a change to
some
| > code.
| > | Then we always click Save to save the code.
| > | Or you can do it in the reverse order.
| > |
| > |
| > | Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
| > |
| > |
| > | | > | >I hadn't done a decompile before so I didn't know what to expect.
| > | > It appears similar to a Compact but when I open the VB code,
| > | > Clicking Debug shows Compile greyed out. Did the decompie work?
| > | > I did it twice.
| > | >
| > | > In any case, I can still save an unvalidated detail record.
| > | >
| > | > --
| > | > Len
| > | > ______________________________________________________
| > | > remove nothing for valid email address.
| >
| >
| >
|
|
 
L

.Len B

Thanks everyone for your perseverance.
The decompile must have worked because the event is now
firing consistently!!!!!
--
Len
______________________________________________________
remove nothing for valid email address.
| Here is my decompile procedure.
| However it is quite a long time since I have needed to do a decompile.
|
| Here is my decompile procedure...
| ----start of decompile notes-----------
| Open Access normally and Compact
| Open with Decompile switch, then close
| Open Access normally and compact again
| Do a compile and save all
| Compact again
|
| All of the above on a *copy* of the file. If all goes well I replace
the
| original with the copy.
|
| To decompile, I usually go via Start => Run...
| "C:\Program Files\...etc...\MSACCESS.EXE" /decompile
"C:\MyFolder\MyDb.mdb"
| After this, compile again.
| Steve Schapel
|
| "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
|
| A shortcut named something like Access Decompile can be created one
time,
| and then used to open any database. A database that you open with this
| shortcut will be decompiled. For example, I have
| three such shortcuts that I created for my PC, since I have Access 97,
2000
| and 2002 loaded on my machine. I find this a lot easier than typing out
the
| path in the Start => Run... dialog each time.
|
| Name:
| Access 97 Decompile
| Target:
| "C:\Program Files\Microsoft Office 97\Office\msaccess.exe" /decompile
|
| Name:
| Access 2000 Decompile
| Target:
| "C:\Program Files\Microsoft Office 2000\Office\msaccess.exe" /decompile
|
| Name:
| Access 2002 Decompile
| Target:
| "C:\Program Files\Microsoft Office XP\Office10\msaccess.exe" /decompile
|
|
| "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" /decompile
| ---------------------------
| Tom
|
| Thanks a lot, Tom, for this good suggestion. However, I personally
don't
| "type out the path in the Start => Run... dialog each time". I just
select
| the item I want from the combobox on the Start => Run dialog. :)
|
| -- Steve Schapel, Microsoft Access MVP
|
| I tend to use the Clear button on the Advanced tab of the Taskbar and
Start
| Menu Properties dialog fairly often. Call me paranoid, but I don't like
to
| leave snail trails that others can use to snoop around and see what
I've
| been up to. So, in my case, that would mean having to retype it each
time
| (or search for the correct version of msaccess.exe and drag-n-drop it
onto
| the Start => Run dialog.
| Tom
| --end of decompile notes-----------
|
| | >I was surprised to see that the code was compiled after I had just
| > done a decompile. I wondered if it really did decompile.
| >
| > --
| > Len
| > ______________________________________________________
| > remove nothing for valid email address.
message
| > | > | When Compile is greyed out, all the code is compiled.
| > | Once you start to edit some of the code, it will become uncompiled.
| > | We usually click Debug | Compile every time we make a change to
some
| > code.
| > | Then we always click Save to save the code.
| > | Or you can do it in the reverse order.
| > |
| > |
| > | Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
| > |
| > |
| > | | > | >I hadn't done a decompile before so I didn't know what to expect.
| > | > It appears similar to a Compact but when I open the VB code,
| > | > Clicking Debug shows Compile greyed out. Did the decompie work?
| > | > I did it twice.
| > | >
| > | > In any case, I can still save an unvalidated detail record.
| > | >
| > | > --
| > | > Len
| > | > ______________________________________________________
| > | > remove nothing for valid email address.
| >
| >
| >
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top