I have been reviewing some old code within the forum and came across this;
What does this line represent "![Flow] = Str"?For index = 1 To intI .Edit ![Flow] = str .Update .MoveNext Next
I have been reviewing some old code within the forum and came across this;
What does this line represent "![Flow] = Str"?For index = 1 To intI .Edit ![Flow] = str .Update .MoveNext Next
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
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 linkDots 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.
---------------------------------------------------------------------------------------------------------------------
Paul
Remember: Tell us WHAT you want to do, not HOW you think you want to do it
1. Use [CODE] ....[/CODE ] Tags for readability
[CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
2. Upload an example
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
3. Mark the thread as [Solved] when you have an answer
Thread Tools (on the top right corner, above the first message)
4. Read the Forum FAQ, especially the part about cross-posting in other forums
http://www.vbaexpress.com/forum/faq...._new_faq_item3
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?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
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
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
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
---------------------------------------------------------------------------------------------------------------------
Paul
Remember: Tell us WHAT you want to do, not HOW you think you want to do it
1. Use [CODE] ....[/CODE ] Tags for readability
[CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
2. Upload an example
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
3. Mark the thread as [Solved] when you have an answer
Thread Tools (on the top right corner, above the first message)
4. Read the Forum FAQ, especially the part about cross-posting in other forums
http://www.vbaexpress.com/forum/faq...._new_faq_item3