changing form properties from VBA

R

Robert Nolty

Hi all --

I am a neophyte Access programmer. I have a form with a
subform, and a 1 to many relationship between the record in
the form (courses) and the subform (courseComments). There
can be zero to many comments for each course. I made the
subform with a default view of continuous form, so that
they will all display. I don't want to make that form
updateable; I think that would be OK for me but confusing
to my users. I prefer them to be obviously read-only most
of the time, and editing for brief, definite periods of
time which they exit to return to reading. So in the
subform, each detail has an EDIT button, and the header has
a CREATE NEW button.

My problem is what to do when they push one of those
buttons. What I would most like to do I think is probably
impossible -- that would be to make just one detail
updateable, and change its special effect from flat to
sunken. The user would edit that one record, then click a
DONE button to return to the usual mode. However, it
appears to me to be impossible to give 1 detail different
properties than all the other details.

Failing that, it would be acceptable to convert the subform
to "single form" from "continuous form" mode. However, I
don't see a property of form to do that. I even tried
programmatically changing the default view, but when I
executed that while in form view, I got an error message
saying I could only do that while in design view.

Does anyone have any ideas -- either how to do what I want
to do, or what would be better to do?

Thanks!
Bob
 
H

HSalim

Bob,
Consider creating a separate form that would let you enter the comments into
that form.
when the user clicks on that button, open a simple form that contains the
CourseCommentID (which could be hidden)
and the text as it exists today, and a command button that would save and
close the form.

HS
 
L

Larry Linson

I have often used a continous forms view (summary) to select a form for
editing (details) when any control or the space between controls on the
continuous forms view is double-clicked. That uses the unique id of the
currently-selected record in the WhereCondition argument of a DoCmd.OpenForm
to open the detail form.

I can't recall that I have done it in a Continous Form view Form embedded in
a Subform Control, but don't see any reason it shouldn't work. You may have
to Requery the Subform Control after you update/edit/add the new record to
make it show.

Larry Linson
Microsoft Access MVP
 

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