Please let me know what I am doing wrong. I'm trying to work my add comment form to work for all forms where a comment is required. So, when I call it from the different forms I set the tag property to the form's name and use it to initialize my shared form variable and call the function to fill the richtextbox in the calling form which it needs to use the same name in the calling form. The part that is not working is: frm.txtComments.text It says that txtComments is not a member of System.Windows.Forms.Form.
This is the code:
Public Class frmAddComment
Shared frm As Form
Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
Private Sub AddCommentToTextBox(ByVal frm As Form)
frm.txtComments.text = frm.txtComments.text & vbCrLf & Now() & ".." & Me.txtNewComment.Text
Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
Me.txtNewComment.Text = ""
Public Sub New()
If Me.Tag = "frmDetail" Then
frm = frmDetail
ElseIf Me.Tag = "frmNewProspect" Then
frm = frmNewProspect