Notes on a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a app that tracks projects. I want to have each note entry as a
seperate entry for reporting. I assume I will use a join to link the note
entry to the main table where the header for the projects is located.

Is there somewhere I can find a sample form/code?
 
Pat,

You will need to add the Notes field to whichever table you want to have
a note for each record.
 
Pat,

It sounds like you will have many notes per project. The natural way to
implement this is to create a new table, called, say ProjectNotes, and use a
continuous subform for it embedded on your main Projects form, linked by the
primary key of Projects, presumably ProjectID:

ProjectNotes
--------------
ProjectNoteID AutoNumber (Primary Key)
ProjectID Integer (Foreign Key to Projects)
Note Text or Memo
NoteDate Date/Time

Hope that helps.
Sprinks
 
That's what I was planning. What do I need to do to have the ability to edit
the notes on the subform? I have used subforms on other forms, but I'm not
sure how to create a function to edit the record which is selected in the
subform.

Also if you know of a way to default the text to be the dat/time and place
the cursor at the end ready to type the note. I have tried the SENDKEY
function to some success.
 
Pat,

By default, there is nothing required to enable records in a subform, or
main form for that matter to be edited. You may, however, set form
properties to disable this ability. If other subforms you're using are
unable to be edited, check the form's AllowEdits property. The value of the
AllowAdditions & AllowDeletions properties control whether new records can be
added or existing ones deleted, respectively, and the DataEntry property, if
set to Yes, allows only new records to be added.

I suggest you have a separate field for the Date/Time, and set its
DefaultValue property to Date(), which inserts the current date. If you wish
to capture the time as well, set the property to Now(). As to placing the
cursor in the Notes field, you can use the subform's On Current event
procedure to set the focus to the Notes field:

Me!YourNotesField.SetFocus

I also suggest learning a bit more about VBA. It might seem intractable
coming to it from no perspective, but it really comes down to the object
model, and properties and methods. Once you learn the basic gist, you can
quickly get up to speed. One good way is to create event procedures using
the wizard (Turn on the wizard by View, Toolbox, and select the icon with the
wand and stars), and studying the code it creates. The sample app Northwind
(Help, Sample Databases) also provides a good way to learn.

Hope that helps.
Sprinks
 
Sorry I guess I am dancing aound the issue. I have used proceedures and
properties. What I am having a problem understanding is how to have a
command button on the main form to edit the row selected on the sub form.

Example:
2 Tables
Projects (ID, projectID, Name, etc)
ProjNotes (ID, projectID, noteID, notes, datestmp, user, etc )
Join on projectID fields

projectID = 1 (of 100)
noteID = 5 (of 10 for projectID=5)

I am unable to reference the feild on the subform to get the focus set. For
example if I attempt to referemce form![projsub]![noteID] from the main form
it generated an error.

How can I select a particular record, in this example 5, on the subform and
call my edit procedure to edit the notes?
 
Pat,

I might be missing something. It seems if you want to edit the row selected
in the subform, you just need to click into the subform to do it. But,
anyhow, to set the focus to a specific field in the current record of a
subform, you first set the focus to the subform, and then to the specific
control, using the .Form property of the subform control to refer to the
subform *itself*, where the subform controls are located.

Me![YourSubform].SetFocus
Me![YourSubform].Form![YourSubformControl]

Hope that helps.
Sprinks


Pat said:
Sorry I guess I am dancing aound the issue. I have used proceedures and
properties. What I am having a problem understanding is how to have a
command button on the main form to edit the row selected on the sub form.

Example:
2 Tables
Projects (ID, projectID, Name, etc)
ProjNotes (ID, projectID, noteID, notes, datestmp, user, etc )
Join on projectID fields

projectID = 1 (of 100)
noteID = 5 (of 10 for projectID=5)

I am unable to reference the feild on the subform to get the focus set. For
example if I attempt to referemce form![projsub]![noteID] from the main form
it generated an error.

How can I select a particular record, in this example 5, on the subform and
call my edit procedure to edit the notes?

Sprinks said:
Pat,

By default, there is nothing required to enable records in a subform, or
main form for that matter to be edited. You may, however, set form
properties to disable this ability. If other subforms you're using are
unable to be edited, check the form's AllowEdits property. The value of the
AllowAdditions & AllowDeletions properties control whether new records can be
added or existing ones deleted, respectively, and the DataEntry property, if
set to Yes, allows only new records to be added.

I suggest you have a separate field for the Date/Time, and set its
DefaultValue property to Date(), which inserts the current date. If you wish
to capture the time as well, set the property to Now(). As to placing the
cursor in the Notes field, you can use the subform's On Current event
procedure to set the focus to the Notes field:

Me!YourNotesField.SetFocus

I also suggest learning a bit more about VBA. It might seem intractable
coming to it from no perspective, but it really comes down to the object
model, and properties and methods. Once you learn the basic gist, you can
quickly get up to speed. One good way is to create event procedures using
the wizard (Turn on the wizard by View, Toolbox, and select the icon with the
wand and stars), and studying the code it creates. The sample app Northwind
(Help, Sample Databases) also provides a good way to learn.

Hope that helps.
Sprinks
 
Thanks this is what I was missing I think.

Sprinks said:
Pat,

I might be missing something. It seems if you want to edit the row selected
in the subform, you just need to click into the subform to do it. But,
anyhow, to set the focus to a specific field in the current record of a
subform, you first set the focus to the subform, and then to the specific
control, using the .Form property of the subform control to refer to the
subform *itself*, where the subform controls are located.

Me![YourSubform].SetFocus
Me![YourSubform].Form![YourSubformControl]

Hope that helps.
Sprinks


Pat said:
Sorry I guess I am dancing aound the issue. I have used proceedures and
properties. What I am having a problem understanding is how to have a
command button on the main form to edit the row selected on the sub form.

Example:
2 Tables
Projects (ID, projectID, Name, etc)
ProjNotes (ID, projectID, noteID, notes, datestmp, user, etc )
Join on projectID fields

projectID = 1 (of 100)
noteID = 5 (of 10 for projectID=5)

I am unable to reference the feild on the subform to get the focus set. For
example if I attempt to referemce form![projsub]![noteID] from the main form
it generated an error.

How can I select a particular record, in this example 5, on the subform and
call my edit procedure to edit the notes?

Sprinks said:
Pat,

By default, there is nothing required to enable records in a subform, or
main form for that matter to be edited. You may, however, set form
properties to disable this ability. If other subforms you're using are
unable to be edited, check the form's AllowEdits property. The value of the
AllowAdditions & AllowDeletions properties control whether new records can be
added or existing ones deleted, respectively, and the DataEntry property, if
set to Yes, allows only new records to be added.

I suggest you have a separate field for the Date/Time, and set its
DefaultValue property to Date(), which inserts the current date. If you wish
to capture the time as well, set the property to Now(). As to placing the
cursor in the Notes field, you can use the subform's On Current event
procedure to set the focus to the Notes field:

Me!YourNotesField.SetFocus

I also suggest learning a bit more about VBA. It might seem intractable
coming to it from no perspective, but it really comes down to the object
model, and properties and methods. Once you learn the basic gist, you can
quickly get up to speed. One good way is to create event procedures using
the wizard (Turn on the wizard by View, Toolbox, and select the icon with the
wand and stars), and studying the code it creates. The sample app Northwind
(Help, Sample Databases) also provides a good way to learn.

Hope that helps.
Sprinks


:

That's what I was planning. What do I need to do to have the ability to edit
the notes on the subform? I have used subforms on other forms, but I'm not
sure how to create a function to edit the record which is selected in the
subform.

Also if you know of a way to default the text to be the dat/time and place
the cursor at the end ready to type the note. I have tried the SENDKEY
function to some success.

:

Pat,

It sounds like you will have many notes per project. The natural way to
implement this is to create a new table, called, say ProjectNotes, and use a
continuous subform for it embedded on your main Projects form, linked by the
primary key of Projects, presumably ProjectID:

ProjectNotes
--------------
ProjectNoteID AutoNumber (Primary Key)
ProjectID Integer (Foreign Key to Projects)
Note Text or Memo
NoteDate Date/Time

Hope that helps.
Sprinks

:

I have a app that tracks projects. I want to have each note entry as a
seperate entry for reporting. I assume I will use a join to link the note
entry to the main table where the header for the projects is located.

Is there somewhere I can find a sample form/code?
 
Back
Top