For whatever reason I cannot get debugging to work. But let me say this... if I put the following code in an onclick event of the field, "txtCombinedCbxRecordInfo", which is the field I am trying to populate with the oncurrent event of the form, IT WORKS!!! Here is the code that is workig on the onclick event... (Please read below this copy/pasted code)
-=-=-=-=-=-=-=-
' Code to fill combine field with concatenated text
Dim rst As dao.Recordset
Dim txt As String
If Not Me.NewRecord Then
'open a recordset on the child records of the current record in Me
Set rst = CurrentDb.OpenRecordset( _
"SELECT [Core Sand Type] " & _
"FROM tblCbxNumberData " & _
"WHERE PartN = '" & Me.cboPartN & "'")
With rst
Do While Not .EOF
'if the field is non-null, concatenate
If Not IsNull(.Fields(0)) Then txt = txt & .Fields(0) & "/"
.MoveNext
Loop
.Close
End With
'drop the trailing "/"
If txt <> "" Then txt = Left(txt, Len(txt) - 1)
End If
Me.txtCombinedCbxRecordInfo = txt
' End of code to fill combine field with concatenated text
-=-=-=-=-=-=-
But when I put this same code in the on current event of the form along with other code I have had in there for some time, it does not work. Here is the complete on current event code...
-=-=-=-=-
'for developmental purposes
'If Len(Dir("C:\Company\General Shared Files\PRINTS\" & Me.txtPartN & "\*.*")) = 0 Then
' Me.chkprints = False
'Else
' Me.chkprints = True
'End If
'end of for developmental purposes
'for State Line purposes
If Len(Dir("\\Sbs1\Company\General Shared Files\PRINTS\" & Me.txtPartN & "\*.*")) = 0 Then
Me!chkprints = False
Else
Me!chkprints = True
End If
'end of for stateline purposes
Me.List1.Requery
Me.txtCPC = DSum("CPC", "tblCbxNumberData", "(PartN = '" & Me.txtPartN & "')")
Me.txtCBs = DCount("CPC", "tblCbxNumberData", "(PartN = '" & Me.txtPartN & "')")
' Code to fill combine field with concatenated text
Dim rst As dao.Recordset
Dim txt As String
If Not Me.NewRecord Then
'open a recordset on the child records of the current record in Me
Set rst = CurrentDb.OpenRecordset( _
"SELECT [Core Sand Type] " & _
"FROM tblCbxNumberData " & _
"WHERE PartN = '" & Me.cboPartN & "'")
With rst
Do While Not .EOF
'if the field is non-null, concatenate
If Not IsNull(.Fields(0)) Then txt = txt & .Fields(0) & "/"
.MoveNext
Loop
.Close
End With
'drop the trailing "/"
If txt <> "" Then txt = Left(txt, Len(txt) - 1)
End If
Me.txtCombinedCbxRecordInfo = txt
' End of code to fill combine field with concatenated text
-=-=-=-=-
Any thoughts?
-=-=-=-=-=-=-=-
' Code to fill combine field with concatenated text
Dim rst As dao.Recordset
Dim txt As String
If Not Me.NewRecord Then
'open a recordset on the child records of the current record in Me
Set rst = CurrentDb.OpenRecordset( _
"SELECT [Core Sand Type] " & _
"FROM tblCbxNumberData " & _
"WHERE PartN = '" & Me.cboPartN & "'")
With rst
Do While Not .EOF
'if the field is non-null, concatenate
If Not IsNull(.Fields(0)) Then txt = txt & .Fields(0) & "/"
.MoveNext
Loop
.Close
End With
'drop the trailing "/"
If txt <> "" Then txt = Left(txt, Len(txt) - 1)
End If
Me.txtCombinedCbxRecordInfo = txt
' End of code to fill combine field with concatenated text
-=-=-=-=-=-=-
But when I put this same code in the on current event of the form along with other code I have had in there for some time, it does not work. Here is the complete on current event code...
-=-=-=-=-
'for developmental purposes
'If Len(Dir("C:\Company\General Shared Files\PRINTS\" & Me.txtPartN & "\*.*")) = 0 Then
' Me.chkprints = False
'Else
' Me.chkprints = True
'End If
'end of for developmental purposes
'for State Line purposes
If Len(Dir("\\Sbs1\Company\General Shared Files\PRINTS\" & Me.txtPartN & "\*.*")) = 0 Then
Me!chkprints = False
Else
Me!chkprints = True
End If
'end of for stateline purposes
Me.List1.Requery
Me.txtCPC = DSum("CPC", "tblCbxNumberData", "(PartN = '" & Me.txtPartN & "')")
Me.txtCBs = DCount("CPC", "tblCbxNumberData", "(PartN = '" & Me.txtPartN & "')")
' Code to fill combine field with concatenated text
Dim rst As dao.Recordset
Dim txt As String
If Not Me.NewRecord Then
'open a recordset on the child records of the current record in Me
Set rst = CurrentDb.OpenRecordset( _
"SELECT [Core Sand Type] " & _
"FROM tblCbxNumberData " & _
"WHERE PartN = '" & Me.cboPartN & "'")
With rst
Do While Not .EOF
'if the field is non-null, concatenate
If Not IsNull(.Fields(0)) Then txt = txt & .Fields(0) & "/"
.MoveNext
Loop
.Close
End With
'drop the trailing "/"
If txt <> "" Then txt = Left(txt, Len(txt) - 1)
End If
Me.txtCombinedCbxRecordInfo = txt
' End of code to fill combine field with concatenated text
-=-=-=-=-
Any thoughts?