H
HKComputer
I'm new to programming and new to access, though I have studied
database programming for quite some time now. Pardon me, my questions
might almost be outside the scope of interests and capabilities of this
newsgroup, but I hope not.
I'm building several applications in Access. To help you understand, I
am not building an Access "project". Neither am I connecting to an
outside data source through ODBC or any other technology. We are
working with a single .mdb file here.
I'd disenchanted with the bound forms I get in Access. Records become
records as soon the user starts to enter data. I prefer to have
extensive form-level validation and give the user limited options to
prevent incomplete records and surprise edits or deletes. I'll tell
you what I want to achieve and then I'd like some recommendations.
I'd like my forms (bound or unbound) to display the current record
selected using either my combo box or list box. This I have already
achieved in a bound form.
When the record and it's child records are displayed, edits should be
disallowed to prevent accidental edits or deletion of of data.
I'd like to have the following buttons on my form:
Edit
Allows edits. Enables a cancel button that undoes the edit on this
record and goes back to locked fields. Enables a save button to save
changes to this record. (Seems that to get these options the form will
need to be unbound?) Disables the exit form button. Disables the Add
New button.
Add New
Moves to a new blank record. Disables all other buttons except save
and cancel. Save button and cancel button would act as I described in
my paragraph above for the edit button. Exit Form and Edit buttons
would be disabled.
Cancel
Cancel would only be available during an edit or add new operation.
Whether it undoes something or deletes the current record, in order to
appear canceled, I don't care. I just want to cancel the current edit
or add new operation.
Exit Form
This button's purpose is obvious. This operation would never be
allowed in an edit or add new operation.
Delete
This button would not be enabled in an edit or add new operation. It
would require either a password or clicking on an OK button to actually
delete a record. I'm even considering the idea of marking these
records in a status field with a corresponding letter or number and not
actually deleting them until the end of the month so that the user can
restore a deleted record if ultimately necessary.
First, can my needs be achieved using a traditional Access bound form?
If so, I wouldn't mind some examples for my button code and how to lock
and unlock my controls for edit. I cannot lock my whole form at once
because that disables my combo and list box that is used to find the
correct record.
Should I use an unbound form and then use ADO to open a recordset and
fill in my fields/controls according the current record selected on my
combo or list box? Do I need to use ADO?
Should I use ADO's methods to add new, edit, and delete records? Or do
I use SQL commands to achieve that? Does it matter?
I'm not asking how to program my whole form here. I rather want
opinions on my options to get the bullet-proof form I'm asking for.
database programming for quite some time now. Pardon me, my questions
might almost be outside the scope of interests and capabilities of this
newsgroup, but I hope not.
I'm building several applications in Access. To help you understand, I
am not building an Access "project". Neither am I connecting to an
outside data source through ODBC or any other technology. We are
working with a single .mdb file here.
I'd disenchanted with the bound forms I get in Access. Records become
records as soon the user starts to enter data. I prefer to have
extensive form-level validation and give the user limited options to
prevent incomplete records and surprise edits or deletes. I'll tell
you what I want to achieve and then I'd like some recommendations.
I'd like my forms (bound or unbound) to display the current record
selected using either my combo box or list box. This I have already
achieved in a bound form.
When the record and it's child records are displayed, edits should be
disallowed to prevent accidental edits or deletion of of data.
I'd like to have the following buttons on my form:
Edit
Allows edits. Enables a cancel button that undoes the edit on this
record and goes back to locked fields. Enables a save button to save
changes to this record. (Seems that to get these options the form will
need to be unbound?) Disables the exit form button. Disables the Add
New button.
Add New
Moves to a new blank record. Disables all other buttons except save
and cancel. Save button and cancel button would act as I described in
my paragraph above for the edit button. Exit Form and Edit buttons
would be disabled.
Cancel
Cancel would only be available during an edit or add new operation.
Whether it undoes something or deletes the current record, in order to
appear canceled, I don't care. I just want to cancel the current edit
or add new operation.
Exit Form
This button's purpose is obvious. This operation would never be
allowed in an edit or add new operation.
Delete
This button would not be enabled in an edit or add new operation. It
would require either a password or clicking on an OK button to actually
delete a record. I'm even considering the idea of marking these
records in a status field with a corresponding letter or number and not
actually deleting them until the end of the month so that the user can
restore a deleted record if ultimately necessary.
First, can my needs be achieved using a traditional Access bound form?
If so, I wouldn't mind some examples for my button code and how to lock
and unlock my controls for edit. I cannot lock my whole form at once
because that disables my combo and list box that is used to find the
correct record.
Should I use an unbound form and then use ADO to open a recordset and
fill in my fields/controls according the current record selected on my
combo or list box? Do I need to use ADO?
Should I use ADO's methods to add new, edit, and delete records? Or do
I use SQL commands to achieve that? Does it matter?
I'm not asking how to program my whole form here. I rather want
opinions on my options to get the bullet-proof form I'm asking for.