I have been reviewing some old code within the forum and came across this;
What does this line represent "![Flow] = Str"?Code:For index = 1 To intI
.Edit
![Flow] = str
.Update
.MoveNext
Next
Printable View
I have been reviewing some old code within the forum and came across this;
What does this line represent "![Flow] = Str"?Code:For index = 1 To intI
.Edit
![Flow] = str
.Update
.MoveNext
Next
I know nothing about VBA and Access, but
https://www.msaccesstips.com/2016/07...sage-with.html
but I didn't even understand the examples in the link :crying:Quote:
Dots and Exclamation Symbols.
General Usages of the dot (.) and exclamation symbol (!) in object references.
- A dot (.) - after an object name to access its methods or properties.
- The exclamation mark (!) - after an object name, refers to the sub-object or control of the Top-level Object.
Okay here's the full code as presented
The "![ ...something...]" is used more than once in the code. Lines 15, 16, 21, 25, 26, 31, 33,& 40 within the Function subset. Is it referring to a record within a table?Code:Option Compare Database
Function een_tabel()
Dim db As dao.Database
Dim opentbl As dao.Recordset
Dim intI As Integer, index As Integer ', teller As Long
Dim dummy As String, dummynext As String, str As String
On Error GoTo ErrorHandler
Set db = CurrentDb
Set opentbl = db.OpenRecordset("Test_old", dbOpenDynaset)
If opentbl.EOF Then Exit Function
'teller = 0
With opentbl
Do Until .EOF
intI = 1
str = ""
dummy = ![ORDERID]
str = ![Groep_Machines]
.MoveNext
If .EOF Then
dummynext = 1
Else
dummynext = ![ORDERID]
End If
Do Until (dummy <> dummynext)
intI = intI + 1
str = str & "_" & ![Groep_Machines]
dummy = ![ORDERID]
.MoveNext
If .EOF Then
dummynext = 1
Else
dummynext = ![ORDERID]
End If
'dummynext = ![ORDERID]
Loop
For index = 1 To intI
.MovePrevious
Next
For index = 1 To intI
.Edit
![Flow] = str
.Update
.MoveNext
Next
'teller = teller + 1
'If teller = 320000 Then
'MsgBox "stop"
'End If
Loop
End With
opentbl.Close
Set opentbl = Nothing
Set db = Nothing
Exit Function
ErrorHandler:
MsgBox "Fout doorgeven aan Danny" & vbCrLf & vbCrLf & "Error Number: " & _
Err.Number & vbCrLf & "Error Source:" & Error.Source & vbCrLf & "Error Description: " & _
Err.Description, vbCritical, "FOUT!"
Exit Function
End Function
you are working with recordset from a table (Test_old).
"Flow" is a Text field on your table and each record is being assigned same string (str) to it.
Thank you