I think it might be prudent to revise my response to this in view of the way
it seems to be working out at the moment.....the Aneurism # DOES show up in
the sub-form after all, it would appear. I have implemented a disabling of
the field from the user adding that property to list of other controls (i.e.
ID and Reviewer). I thought that it would 'immediately' appear once the
values of ID and Reviewer appeared (ID comes from the parent and the
relationship and Reviewer is entered as a default value), but I see now that
the Aneurism field is empty until the cursor moves to the next record, which
brings me to my next and hopefully final question about this issues. You see,
there is an upper limit of 4 Aneurisms allowed at this point, and I have
established that upper limit (as "<= 4") in the properties fields of the
table and subform's for this Aneurism control. So when you try to exceed it,
whether intentionally or otherwies, you currently get a -2147352767
(80020009) error citing the fact that it's bumping up against the upper limit
I established. What would be cooler would be something other than this gnarly
looking error message which would totally space out my high school level
user. I know that you can program custom tailored error messages, however I
can not because of my unfamiliarity, but the behavior would be something like
this, a msg telling the user that the upper limit of 4 was reached and that
it was time to back off.
Thoughts (or is this a new thread)?
Marshall Barton said:
If you are editing your subform as part of the main form,
then the first click in the subform only select the subform
control that contains the form object it will display. If
you the click again in the subform's upper left corner where
the two rulers come together you should see the form
object's property sheet.
Personally, I really dislike that combined design view. I
prefer to close the main form and open the subform's form
object directly from the database window.
However you get to the subform's design view, you still need
to add the code to the subform's BeforeUpdate event.
--
Marsh
MVP [MS Access]
Access said:
Easier said than done, if by FORM you meant sub-Form, then the only Event
Properties I see when I click on its name as it appears nested on the parent
were On Enter and On Exit. If you meant the parent form, then it turns out
A2K02 won't let me even see the properties, for some reason.
Marshall Barton said:
That's the wrong BeforeUpdate event. The code is supposed
to be in the FORM's BeforeUpdate event.
Access User wrote:
Well, it seems as though the tbl_Aneurism reference in the VBA might need
updating as the subform seems to be using a qry_Aneurism which depends upon
tbl_Aneurism, so here's the revised VBA
Private Sub Aneurism_BeforeUpdate(Cancel As Integer)
Me.[Aneurism] = Nz(DMax("[Aneurism]", "qry_Aneurism", "ID=" _
& Me.ID), 0) + 1