Hello:
Any help on some ideas would be greatly appreciated
I'm trying to reuse some code that I use on a form in regular "Form View", but have it read the current active Subform which is in Datasheet view. I tried inserting in the code below "Screen.ActiveDatasheet", but looks to convoluted trying to access the current record with x and y positions as if you're using a grid. I mean it's a form(subform) for crying out loud... Any way here's the standard issue code similar to what's the help screens...
Dim ctl As Control
Dim strFieldValues As String, strFieldNames As String
strFieldValues = ""
strFieldNames = ""
Select Case strFieldPrefix
Case "EditSheet"
For Each ctl In Screen.ActiveForm.Controls
If TypeOf ctl Is TextBox Then
If Mid$(ctl.Name, Len(ctl.Name) - 1) = "ID" Then
Else
If Not ctl.Value = "" Then
strFieldNames = strFieldNames & ctl.Name & "||"
strFieldValues = strFieldValues & ctl.Value & "||"
End If
End If
End If
Next
strFieldNames=strFieldNames& "<<"& vbLf& strFieldValues & "<<" & vbLf
Any help on some ideas would be greatly appreciated
I'm trying to reuse some code that I use on a form in regular "Form View", but have it read the current active Subform which is in Datasheet view. I tried inserting in the code below "Screen.ActiveDatasheet", but looks to convoluted trying to access the current record with x and y positions as if you're using a grid. I mean it's a form(subform) for crying out loud... Any way here's the standard issue code similar to what's the help screens...
Dim ctl As Control
Dim strFieldValues As String, strFieldNames As String
strFieldValues = ""
strFieldNames = ""
Select Case strFieldPrefix
Case "EditSheet"
For Each ctl In Screen.ActiveForm.Controls
If TypeOf ctl Is TextBox Then
If Mid$(ctl.Name, Len(ctl.Name) - 1) = "ID" Then
Else
If Not ctl.Value = "" Then
strFieldNames = strFieldNames & ctl.Name & "||"
strFieldValues = strFieldValues & ctl.Value & "||"
End If
End If
End If
Next
strFieldNames=strFieldNames& "<<"& vbLf& strFieldValues & "<<" & vbLf