G
Guest
My form is set up based on a query with a subform. I have an unbound text
box which has the following code:
=====================================================
Private Sub CallEvent_AfterUpdate()
Dim fldIn As String
Dim fldOutA As String
Dim fldOutB As String
Dim fldOutC As String
fldIn = Forms![frm_CFS]![CallEvent]
If IsNull(fldIn) Then Exit Sub
fldOutA = UCase(ParseText(fldIn, 0, ";")) ' ID Number
fldOutB = UCase(ParseText(fldIn, 1, ";")) ' Time
fldOutC = UCase(ParseText(fldIn, 2, ";")) ' Details
If fldOutA = "" Then fldOutA = ParseText(Forms![frm_CFS]![OfcrPri], 0, " --
")
If fldOutB = "" Then fldOutB = Format(Time(), "Short Time")
If fldOutC = "" Then Exit Sub
' will not work - start section
Forms![frm_CFS]![CE_CCNo] = Forms![frm_CFS]![CCNo]
Forms![frm_CFS]![CE_Date] = Format(Date, "yyyy-mm-dd")
Forms![frm_CFS]![CE_Time] = fldOutB
Forms![frm_CFS]![CE_Unit] = fldOutA
Forms![frm_CFS]![CE_User] = Left(CurrentUser(), 3)
Forms![frm_CFS]![CE_Event] = fldOutC
' end section
Forms![frm_CFS]![CallEvent] = ""
End Sub
=====================================================
The section identified above as "will not work" is trying to take the values
from the text box and add them to the recordset in the subform. It will not
write the values stating that it cannot find the field in the subform.
I also tried the Child! command and it did not work either.
Any suggestions would be appreciated.
box which has the following code:
=====================================================
Private Sub CallEvent_AfterUpdate()
Dim fldIn As String
Dim fldOutA As String
Dim fldOutB As String
Dim fldOutC As String
fldIn = Forms![frm_CFS]![CallEvent]
If IsNull(fldIn) Then Exit Sub
fldOutA = UCase(ParseText(fldIn, 0, ";")) ' ID Number
fldOutB = UCase(ParseText(fldIn, 1, ";")) ' Time
fldOutC = UCase(ParseText(fldIn, 2, ";")) ' Details
If fldOutA = "" Then fldOutA = ParseText(Forms![frm_CFS]![OfcrPri], 0, " --
")
If fldOutB = "" Then fldOutB = Format(Time(), "Short Time")
If fldOutC = "" Then Exit Sub
' will not work - start section
Forms![frm_CFS]![CE_CCNo] = Forms![frm_CFS]![CCNo]
Forms![frm_CFS]![CE_Date] = Format(Date, "yyyy-mm-dd")
Forms![frm_CFS]![CE_Time] = fldOutB
Forms![frm_CFS]![CE_Unit] = fldOutA
Forms![frm_CFS]![CE_User] = Left(CurrentUser(), 3)
Forms![frm_CFS]![CE_Event] = fldOutC
' end section
Forms![frm_CFS]![CallEvent] = ""
End Sub
=====================================================
The section identified above as "will not work" is trying to take the values
from the text box and add them to the recordset in the subform. It will not
write the values stating that it cannot find the field in the subform.
I also tried the Child! command and it did not work either.
Any suggestions would be appreciated.