A
azu_daioh
I have a form for data entry only with 2 controls "initials" and
"notesEntry"
On the main form, there is a link to open the above form
[frm_Logs_NotesEntry] and on the [frm_Logs_NotesEntry] form is a
button to transfer the notes entered to the main form's subform
I will have mutliple forms using the [frm_Logs_NotesEntry] for data
entry and on each form the subform is standard name
sfrm_NAMEOFMAINFORM_NotesOnly.
Here's the code:
Private Sub enterNotes_Click()
Dim xNotes As String
Dim xInitials As String
Dim xDate As Date
Dim yNotes As String
xDate = Date
xNotes = Me.notesEntry
xInitials = Me.Staffinitials
yNotes = xDate & ": " & xNotes & " //" & xInitials
DoCmd.Close acForm, "frm_Logs_NotesEntry"
Dim frmCurrentForm As Form
Dim frmName As String
Dim sfrmName As String
Dim ctlName As String
Set frmCurrentForm = Screen.ActiveForm
frmName = frmCurrentForm.Name
sfrmName = "sfrm_" & frmName & "_NotesOnly"
ctlName = frmName & "." & sfrmName & ".Form." & "LogEntry"
ctlName = yNotes & vbCrLf & vbCrLf & ctlName
End Sub
-----------------------
For example if my main referrals forms =
[frm_IDReferrals], my subform would be named
[sfrm_frm_IDReferrals_NotesOnly]
[frm_ATRefferals], my subform would be named
[sfrm_frm_ATReferrals_NotesOnly]
on each form above, I'm calling the [frm_Logs_NotesEntry] for data
entry and the notes would be then entered on a memo control for each
subform called [LogEntry].
Is there a way to accomplish this without creating a separate
[frm_Logs_NotesEntry] form for each main referrals form?
The above code gives "Type mismatch" error message.
I obviously don't know what I'm doing so please help me out
This is the form I had before that worked:
Dim frmCurrentForm As Form
Set frmCurrentForm = Screen.ActiveForm
frmCurrentForm.sfrm_frm_IDReferralsLog_NotesOnly.Form.LogEntry =
yNotes _
& vbCrLf & vbCrLf _
&
Forms.frm_IDReferralsLog.sfrm_frm_IDReferralsLog_NotesOnly.Form.LogEntry
Thank you,
Sharon
"notesEntry"
On the main form, there is a link to open the above form
[frm_Logs_NotesEntry] and on the [frm_Logs_NotesEntry] form is a
button to transfer the notes entered to the main form's subform
I will have mutliple forms using the [frm_Logs_NotesEntry] for data
entry and on each form the subform is standard name
sfrm_NAMEOFMAINFORM_NotesOnly.
Here's the code:
Private Sub enterNotes_Click()
Dim xNotes As String
Dim xInitials As String
Dim xDate As Date
Dim yNotes As String
xDate = Date
xNotes = Me.notesEntry
xInitials = Me.Staffinitials
yNotes = xDate & ": " & xNotes & " //" & xInitials
DoCmd.Close acForm, "frm_Logs_NotesEntry"
Dim frmCurrentForm As Form
Dim frmName As String
Dim sfrmName As String
Dim ctlName As String
Set frmCurrentForm = Screen.ActiveForm
frmName = frmCurrentForm.Name
sfrmName = "sfrm_" & frmName & "_NotesOnly"
ctlName = frmName & "." & sfrmName & ".Form." & "LogEntry"
ctlName = yNotes & vbCrLf & vbCrLf & ctlName
End Sub
-----------------------
For example if my main referrals forms =
[frm_IDReferrals], my subform would be named
[sfrm_frm_IDReferrals_NotesOnly]
[frm_ATRefferals], my subform would be named
[sfrm_frm_ATReferrals_NotesOnly]
on each form above, I'm calling the [frm_Logs_NotesEntry] for data
entry and the notes would be then entered on a memo control for each
subform called [LogEntry].
Is there a way to accomplish this without creating a separate
[frm_Logs_NotesEntry] form for each main referrals form?
The above code gives "Type mismatch" error message.
I obviously don't know what I'm doing so please help me out
This is the form I had before that worked:
Dim frmCurrentForm As Form
Set frmCurrentForm = Screen.ActiveForm
frmCurrentForm.sfrm_frm_IDReferralsLog_NotesOnly.Form.LogEntry =
yNotes _
& vbCrLf & vbCrLf _
&
Forms.frm_IDReferralsLog.sfrm_frm_IDReferralsLog_NotesOnly.Form.LogEntry
Thank you,
Sharon