Adding Records

  • Thread starter Thread starter imbd4a
  • Start date Start date
I

imbd4a

I am working on a design for a db that part of which involves a primary Form
to add or edit Action Steps ( Form 1) . From this form it is possible to
call up another form that views any related Milestones ( Form 2) or Funds
(Form 3) which are related to any of the Action Steps that are current on
Form 1.



This is clear, simple and works well when viewing or editing existing
Milestones or Funds. The difficultly lies in the ability to add new
Milestones or Fund elements to their respective tables. When calling up
Form 2 or Form 3 from Form 1 it is possible to call up a null set from the
query which is based on the Action Step ID criteria located on Form 1. This
is not really a problem but I would like the ability to add new records to
the Milestones or Funds table. It seems I cannot easily just add a new
record, I assume, since the form view is based on a select query.



I know I could include a button to open a new form that would allow the
addition of new records which would stamp the Action Step ID number into the
ID field, but was wondering if there wasn't a simpler way to handle this
without getting into too many forms.



Any suggestions or ideas would be greatly appreciated.



Thanks
 
If you use subforms for the Milestones and Funds with the linking field
being the foreign key, it is almost automatic. If you prefer a separate
form, you can set the DefaultValue of the control which is bound to the
foreign key to:

=Forms!Form1!txtPrimaryKeyControlName

subtituting your form and control names. Using the same code to open Forms 2
and 3, you can then Open a blank record (when one doesn't exist) which will
be linked to the record in Form 1.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Thanks Marvin,

I like that.

I had to make a few other adjustments and set a few other ID values into the
table to make the records save correctly but that is what I was looking for.
I can now add a new record on the fly where none previous existed so to
speak.

In reference to the subforms, that is what I originally had but my
colleagues who are using the program found them confusing for some reason.
Interesting!
Anyway, thanks again....

BF
 
Sorry....Arvin, no M


imbd4a said:
Thanks Marvin,

I like that.

I had to make a few other adjustments and set a few other ID values into the
table to make the records save correctly but that is what I was looking for.
I can now add a new record on the fly where none previous existed so to
speak.

In reference to the subforms, that is what I originally had but my
colleagues who are using the program found them confusing for some reason.
Interesting!
Anyway, thanks again....

BF


Forms records
 
Back
Top