Notes Form

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

Guest

Hello All

I am trying to link notes created in a form called "Notes" to my data entry
screen called "Data Entry"

I have created a relationship with the ID of the Data Entry Form and the
Customer ID field in the Notes form.

When you type a note it accepts it, however when you click on the command
button (via the data entry form ) to review the note, it does not appear. It
is worth to note that the information typed into the note field is being
captured in the Notes table.

Can anyone tell me what I am doing wrong????
 
Hey Sam,

What's the code behind your command button? It kind of sounds like your
either don't have a criteria behind that cmdButton or it's criteria is not
right.

Shane
 
Shane Thanks for your assistance:-

Code as per command button is:-

Private Sub Add_View_Notes_Click()
On Error GoTo Err_Add_View_Notes_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Notes"

stLinkCriteria = "[Customer ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Add_View_Notes_Click:
Exit Sub

Err_Add_View_Notes_Click:
MsgBox Err.Description
Resume Exit_Add_View_Notes_Click

End Sub

Cheers
 
Hey Sam,

Is [Customer ID] in the Notes Table also? If not, then it looks like to me
that it would need to be in order for you to have a foreign key in your Notes
Table.

If it is then your stLinkCriteria should be:
stLinkCriteria = "[Customer ID] =" & Me![CustomerID]

Assuming [Customer ID] is a number.

Hope this helps,
Shane
Shane Thanks for your assistance:-

Code as per command button is:-

Private Sub Add_View_Notes_Click()
On Error GoTo Err_Add_View_Notes_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Notes"

stLinkCriteria = "[Customer ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Add_View_Notes_Click:
Exit Sub

Err_Add_View_Notes_Click:
MsgBox Err.Description
Resume Exit_Add_View_Notes_Click

End Sub

Cheers
[quoted text clipped - 18 lines]
 
Hello All

I am trying to link notes created in a form called "Notes" to my data entry
screen called "Data Entry"

I have created a relationship with the ID of the Data Entry Form and the
Customer ID field in the Notes form.

Ummm... No. You haven't. You've created a relationship between TABLES;
tables contain data, forms do not. A form is just a window, not a data
repository!
When you type a note it accepts it, however when you click on the command
button (via the data entry form ) to review the note, it does not appear. It
is worth to note that the information typed into the note field is being
captured in the Notes table.

Can anyone tell me what I am doing wrong????

I'd suggest using a Subform rather than two freestanding independent
forms. If you put a subform bound to the Notes table onto your main
form, using the ID fields as the master/child link fields, you'll see
only those notes pertinant to the current record on the main from; and
new notes will inherit the mainform's value of the ID.

John W. Vinson[MVP]
 
Thanks John

It works fine. Just one more question....How Do I delete the note when the
customer record is deleted???

Regards
 
Thanks John

It works fine. Just one more question....How Do I delete the note when the
customer record is deleted???

Regards

Open the Relationships window; select the Join line between Customers
and Notes. Make sure the relational integrity checkbox is checked, and
check the Cascade Deletes button.

Note that this is risky - deleted records are GONE, recovery is
difficult or impossible, and you get very little warning. Accidentally
deleting the wrong customer might delete twenty pages of notes for
that customer, and there's no getting them back!

John W. Vinson[MVP]
 
Back
Top