473,385 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Explosion

I have a problem similar as getting a straight list from multi-level Bills
of Material.

Instead I have parent jobs and subjobs.

Parent / Subjob
A / X
A / Y
A / Z
Y/ B
Y/ C
Z / D
Z / E
F / G

So I would like to get a list, base on reference parent 'A'
X
Y
Z
B
C
D
E

I have spent a few hours without success. I have seen BOM.ZIP on
mvps.org/access, but it is too different.

Anybodt has done something similar?

Nov 13 '05 #1
6 2224
The following VBA function returns an array such as you describe, from a
table named Table1, with the fields Parent and Subjob:

'---------------<< Begin Code >>---------------
Public Function Explosion(Parent As String) As Variant

Dim exPos As Long, exBuffer As String
Dim rs As Recordset
ReDim exTemp(0) As String

exBuffer = "'" & Parent & "'"
Do
Set rs = CurrentDb.OpenRecordset("SELECT Subjob FROM Table1 WHERE
Parent In (" & exBuffer & ") ORDER BY Subjob;")
If rs.RecordCount = 0 Then rs.Close: Exit Do
exBuffer = ""
Do While Not rs.EOF
exBuffer = exBuffer & IIf(exBuffer > "", ",'", "'") & rs!Subjob
& "'"
rs.MoveNext
Loop
rs.Close
exPos = 0
Do
If InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) Then
exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) - exPos - 3)
Else
exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
Len(exBuffer) - exPos - 2)
End If
exPos = InStr(exPos + 1, exBuffer, ",", vbBinaryCompare)
ReDim Preserve exTemp(UBound(exTemp) + 1)
Loop Until exPos = 0
Loop
If UBound(exTemp) Then ReDim Preserve exTemp(UBound(exTemp) - 1)

Explosion = exTemp

End Function
'----------------<< End Code >>----------------

For example, if you want to populate an array named MyList with an explosion
of "A", as you described, you would use:
MyList=Explosion("A")
....and it would populate MyList thus:
MyList(0)="X"
MyList(1)="Y"
MyList(2)="Z"
MyList(3)="B"
MyList(4)="C"
MyList(5)="D"
MyList(6)="E"

See if this works for you.
"Saintor" <sa******@REMOVETHIShotmail.com> wrote in message
news:or**********************@wagner.videotron.net ...
I have a problem similar as getting a straight list from multi-level Bills of Material.

Instead I have parent jobs and subjobs.

Parent / Subjob
A / X
A / Y
A / Z
Y/ B
Y/ C
Z / D
Z / E
F / G

So I would like to get a list, base on reference parent 'A'
X
Y
Z
B
C
D
E

I have spent a few hours without success. I have seen BOM.ZIP on
mvps.org/access, but it is too different.

Anybodt has done something similar?

Nov 13 '05 #2
Thanks for replying. However I get an error (3075). I suspect that
the array is limited by the maximum number of characters allowed for a
string (255) variable exBuffer in this case. Any solution to this?

"ByteMyzer" <sb*@nospam.news.chi.sbcglobal.net> wrote in message news:<%e*****************@newssvr15.news.prodigy.c om>...
The following VBA function returns an array such as you describe, from a
table named Table1, with the fields Parent and Subjob:

'---------------<< Begin Code >>---------------
Public Function Explosion(Parent As String) As Variant

Dim exPos As Long, exBuffer As String
Dim rs As Recordset
ReDim exTemp(0) As String

exBuffer = "'" & Parent & "'"
Do
Set rs = CurrentDb.OpenRecordset("SELECT Subjob FROM Table1 WHERE
Parent In (" & exBuffer & ") ORDER BY Subjob;")
If rs.RecordCount = 0 Then rs.Close: Exit Do
exBuffer = ""
Do While Not rs.EOF
exBuffer = exBuffer & IIf(exBuffer > "", ",'", "'") & rs!Subjob
& "'"
rs.MoveNext
Loop
rs.Close
exPos = 0
Do
If InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) Then
exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) - exPos - 3)
Else
exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
Len(exBuffer) - exPos - 2)
End If
exPos = InStr(exPos + 1, exBuffer, ",", vbBinaryCompare)
ReDim Preserve exTemp(UBound(exTemp) + 1)
Loop Until exPos = 0
Loop
If UBound(exTemp) Then ReDim Preserve exTemp(UBound(exTemp) - 1)

Explosion = exTemp

End Function
'----------------<< End Code >>----------------

For example, if you want to populate an array named MyList with an explosion
of "A", as you described, you would use:
MyList=Explosion("A")
...and it would populate MyList thus:
MyList(0)="X"
MyList(1)="Y"
MyList(2)="Z"
MyList(3)="B"
MyList(4)="C"
MyList(5)="D"
MyList(6)="E"

See if this works for you.
"Saintor" <sa******@REMOVETHIShotmail.com> wrote in message
news:or**********************@wagner.videotron.net ...
I have a problem similar as getting a straight list from multi-level

Bills
of Material.

Instead I have parent jobs and subjobs.

Parent / Subjob
A / X
A / Y
A / Z
Y/ B
Y/ C
Z / D
Z / E
F / G

So I would like to get a list, base on reference parent 'A'
X
Y
Z
B
C
D
E

I have spent a few hours without success. I have seen BOM.ZIP on
mvps.org/access, but it is too different.

Anybodt has done something similar?

Nov 13 '05 #3
The string variable is not limited to 255 characters. That has nothing to
do with it, in any event. If you check the help file in reference to Error:
3075, you will find the following:

<Message> in query expression <expression>. (Error 3075)
The expression you typed isn't valid for the reason indicated in the
message. Make sure you have typed field names and punctuation correctly, and
then try the operation again.
Do any of the values in the records have single or double quotes, or even
commas, in them?
"Saintor" <sa******@hotmail.com> wrote in message
news:2f**************************@posting.google.c om...
Thanks for replying. However I get an error (3075). I suspect that
the array is limited by the maximum number of characters allowed for a
string (255) variable exBuffer in this case. Any solution to this?

"ByteMyzer" <sb*@nospam.news.chi.sbcglobal.net> wrote in message

news:<%e*****************@newssvr15.news.prodigy.c om>...
The following VBA function returns an array such as you describe, from a
table named Table1, with the fields Parent and Subjob:

'---------------<< Begin Code >>---------------
Public Function Explosion(Parent As String) As Variant

Dim exPos As Long, exBuffer As String
Dim rs As Recordset
ReDim exTemp(0) As String

exBuffer = "'" & Parent & "'"
Do
Set rs = CurrentDb.OpenRecordset("SELECT Subjob FROM Table1 WHERE Parent In (" & exBuffer & ") ORDER BY Subjob;")
If rs.RecordCount = 0 Then rs.Close: Exit Do
exBuffer = ""
Do While Not rs.EOF
exBuffer = exBuffer & IIf(exBuffer > "", ",'", "'") & rs!Subjob & "'"
rs.MoveNext
Loop
rs.Close
exPos = 0
Do
If InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) Then
exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) - exPos - 3)
Else
exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
Len(exBuffer) - exPos - 2)
End If
exPos = InStr(exPos + 1, exBuffer, ",", vbBinaryCompare)
ReDim Preserve exTemp(UBound(exTemp) + 1)
Loop Until exPos = 0
Loop
If UBound(exTemp) Then ReDim Preserve exTemp(UBound(exTemp) - 1)

Explosion = exTemp

End Function
'----------------<< End Code >>----------------

For example, if you want to populate an array named MyList with an explosion of "A", as you described, you would use:
MyList=Explosion("A")
...and it would populate MyList thus:
MyList(0)="X"
MyList(1)="Y"
MyList(2)="Z"
MyList(3)="B"
MyList(4)="C"
MyList(5)="D"
MyList(6)="E"

See if this works for you.
"Saintor" <sa******@REMOVETHIShotmail.com> wrote in message
news:or**********************@wagner.videotron.net ...
I have a problem similar as getting a straight list from multi-level

Bills
of Material.

Instead I have parent jobs and subjobs.

Parent / Subjob
A / X
A / Y
A / Z
Y/ B
Y/ C
Z / D
Z / E
F / G

So I would like to get a list, base on reference parent 'A'
X
Y
Z
B
C
D
E

I have spent a few hours without success. I have seen BOM.ZIP on
mvps.org/access, but it is too different.

Anybodt has done something similar?

Nov 13 '05 #4
Since I did not find on internet (surprisingly), here is my solution ( for
the next seeker) to have an exploded list, based on a multi-level structure.
Relatively simple. Table1 is the one with jobs and subjobs and table2 is
the target, with a list of all related subjobs and level found.

Public Sub Explode(newparent As String)
Dim db As DAO.database, rs As DAO.Recordset, iLevel As Integer

DoCmd.SetWarnings False

iLevel = 0

Set db = CurrentDb
Set rs = db.openrecordset("Select subjob from table1 where job='" &
newparent & "'")

If rs.RecordCount = 0 Then GoTo GetOut

iLevel = iLevel + 1
DoCmd.RunSQL "INSERT INTO table2 ( Subjob ) SELECT Subjob FROM Table1 WHERE
Job='" & newparent & "'"
DoCmd.RunSQL "UPDATE table2 SET table2.[Level] = " & iLevel & " WHERE
(((table2.Level)=0));"

rs.Close

R1:

Set rs = db.openrecordset("Select subjob from table2 where Level=" & iLevel)
iLevel = iLevel + 1

If rs.RecordCount = 0 Then GoTo GetOut

rs.MoveFirst
Do Until rs.EOF
newparent = rs!subjob
DoCmd.RunSQL "INSERT INTO table2 ( Subjob ) SELECT Subjob FROM Table1 WHERE
Job='" & newparent & "'"
DoCmd.RunSQL "UPDATE table2 SET table2.[Level] = " & iLevel & " WHERE
(((table2.Level)=0));"
rs.MoveNext
Loop

rs.Close
GoTo R1

GetOut:
DoCmd.SetWarnings True
Set rs = Nothing
Set db = Nothing

End Sub
"Saintor" <sa******@hotmail.com> wrote in message
news:2f**************************@posting.google.c om...
Thanks for replying. However I get an error (3075). I suspect that
the array is limited by the maximum number of characters allowed for a
string (255) variable exBuffer in this case. Any solution to this?

"ByteMyzer" <sb*@nospam.news.chi.sbcglobal.net> wrote in message

news:<%e*****************@newssvr15.news.prodigy.c om>...
The following VBA function returns an array such as you describe, from a
table named Table1, with the fields Parent and Subjob:

'---------------<< Begin Code >>---------------
Public Function Explosion(Parent As String) As Variant

Dim exPos As Long, exBuffer As String
Dim rs As Recordset
ReDim exTemp(0) As String

exBuffer = "'" & Parent & "'"
Do
Set rs = CurrentDb.OpenRecordset("SELECT Subjob FROM Table1 WHERE Parent In (" & exBuffer & ") ORDER BY Subjob;")
If rs.RecordCount = 0 Then rs.Close: Exit Do
exBuffer = ""
Do While Not rs.EOF
exBuffer = exBuffer & IIf(exBuffer > "", ",'", "'") & rs!Subjob & "'"
rs.MoveNext
Loop
rs.Close
exPos = 0
Do
If InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) Then
exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) - exPos - 3)
Else
exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
Len(exBuffer) - exPos - 2)
End If
exPos = InStr(exPos + 1, exBuffer, ",", vbBinaryCompare)
ReDim Preserve exTemp(UBound(exTemp) + 1)
Loop Until exPos = 0
Loop
If UBound(exTemp) Then ReDim Preserve exTemp(UBound(exTemp) - 1)

Explosion = exTemp

End Function
'----------------<< End Code >>----------------

For example, if you want to populate an array named MyList with an explosion of "A", as you described, you would use:
MyList=Explosion("A")
...and it would populate MyList thus:
MyList(0)="X"
MyList(1)="Y"
MyList(2)="Z"
MyList(3)="B"
MyList(4)="C"
MyList(5)="D"
MyList(6)="E"

See if this works for you.
"Saintor" <sa******@REMOVETHIShotmail.com> wrote in message
news:or**********************@wagner.videotron.net ...
I have a problem similar as getting a straight list from multi-level

Bills
of Material.

Instead I have parent jobs and subjobs.

Parent / Subjob
A / X
A / Y
A / Z
Y/ B
Y/ C
Z / D
Z / E
F / G

So I would like to get a list, base on reference parent 'A'
X
Y
Z
B
C
D
E

I have spent a few hours without success. I have seen BOM.ZIP on
mvps.org/access, but it is too different.

Anybodt has done something similar?

Nov 13 '05 #5
Hey, this isn't an indication if ingratitude, now is it? You never
responded to the question I asked. Geez, try to help and run into
ungrateful users.

One more try. Here is a sub that does what you need, with Table1 defining
the Parent and Subjob relationships and Table2 with the following two
fields: Subjob (text field) and LLC (Number field, Long Integer). (LLC - Low
Level Code)

'---------------------<< begin code>>---------------------
Public Sub Explosion(Parent As String)

Dim LLC As Long, qd As QueryDef

Set qd = CurrentDb.CreateQueryDef("")

qd.SQL = "INSERT INTO Table2 (Subjob, LLC) " _
& "SELECT Table1.Subjob, 1 FROM Table1 " _
& "WHERE Table1.Parent='" & Parent & "';"
qd.Execute

If qd.RecordsAffected Then
Do
LLC = LLC + 1
qd.SQL = "INSERT INTO Table2 (Subjob, LLC) " _
& "SELECT Table1.Subjob, " & LLC + 1 _
& " FROM Table1 WHERE Table1.Parent IN " _
& "(SELECT T2.Subjob FROM Table2 AS T2 " _
& "WHERE T2.LLC=" & LLC & ";);"
qd.Execute
Loop Until qd.RecordsAffected = 0
End If

qd.Close
Set qd = Nothing

End Sub
'----------------------<< end code>>----------------------

"Saintor" <sa******@REMOVETHIShotmail.com> wrote in message
news:Uw********************@wagner.videotron.net.. .
Since I did not find on internet (surprisingly), here is my solution ( for
the next seeker) to have an exploded list, based on a multi-level structure. Relatively simple. Table1 is the one with jobs and subjobs and table2 is
the target, with a list of all related subjobs and level found.

Public Sub Explode(newparent As String)
Dim db As DAO.database, rs As DAO.Recordset, iLevel As Integer

DoCmd.SetWarnings False

iLevel = 0

Set db = CurrentDb
Set rs = db.openrecordset("Select subjob from table1 where job='" &
newparent & "'")

If rs.RecordCount = 0 Then GoTo GetOut

iLevel = iLevel + 1
DoCmd.RunSQL "INSERT INTO table2 ( Subjob ) SELECT Subjob FROM Table1 WHERE Job='" & newparent & "'"
DoCmd.RunSQL "UPDATE table2 SET table2.[Level] = " & iLevel & " WHERE
(((table2.Level)=0));"

rs.Close

R1:

Set rs = db.openrecordset("Select subjob from table2 where Level=" & iLevel) iLevel = iLevel + 1

If rs.RecordCount = 0 Then GoTo GetOut

rs.MoveFirst
Do Until rs.EOF
newparent = rs!subjob
DoCmd.RunSQL "INSERT INTO table2 ( Subjob ) SELECT Subjob FROM Table1 WHERE Job='" & newparent & "'"
DoCmd.RunSQL "UPDATE table2 SET table2.[Level] = " & iLevel & " WHERE
(((table2.Level)=0));"
rs.MoveNext
Loop

rs.Close
GoTo R1

GetOut:
DoCmd.SetWarnings True
Set rs = Nothing
Set db = Nothing

End Sub
"Saintor" <sa******@hotmail.com> wrote in message
news:2f**************************@posting.google.c om...
Thanks for replying. However I get an error (3075). I suspect that
the array is limited by the maximum number of characters allowed for a
string (255) variable exBuffer in this case. Any solution to this?

"ByteMyzer" <sb*@nospam.news.chi.sbcglobal.net> wrote in message

news:<%e*****************@newssvr15.news.prodigy.c om>...
The following VBA function returns an array such as you describe, from a table named Table1, with the fields Parent and Subjob:

'---------------<< Begin Code >>---------------
Public Function Explosion(Parent As String) As Variant

Dim exPos As Long, exBuffer As String
Dim rs As Recordset
ReDim exTemp(0) As String

exBuffer = "'" & Parent & "'"
Do
Set rs = CurrentDb.OpenRecordset("SELECT Subjob FROM Table1 WHERE Parent In (" & exBuffer & ") ORDER BY Subjob;")
If rs.RecordCount = 0 Then rs.Close: Exit Do
exBuffer = ""
Do While Not rs.EOF
exBuffer = exBuffer & IIf(exBuffer > "", ",'", "'") & rs!Subjob & "'"
rs.MoveNext
Loop
rs.Close
exPos = 0
Do
If InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) Then
exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) - exPos - 3)
Else
exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
Len(exBuffer) - exPos - 2)
End If
exPos = InStr(exPos + 1, exBuffer, ",", vbBinaryCompare)
ReDim Preserve exTemp(UBound(exTemp) + 1)
Loop Until exPos = 0
Loop
If UBound(exTemp) Then ReDim Preserve exTemp(UBound(exTemp) - 1)

Explosion = exTemp

End Function
'----------------<< End Code >>----------------

For example, if you want to populate an array named MyList with an explosion of "A", as you described, you would use:
MyList=Explosion("A")
...and it would populate MyList thus:
MyList(0)="X"
MyList(1)="Y"
MyList(2)="Z"
MyList(3)="B"
MyList(4)="C"
MyList(5)="D"
MyList(6)="E"

See if this works for you.
"Saintor" <sa******@REMOVETHIShotmail.com> wrote in message
news:or**********************@wagner.videotron.net ...
> I have a problem similar as getting a straight list from multi-level Bills
> of Material.
>
> Instead I have parent jobs and subjobs.
>
> Parent / Subjob
> A / X
> A / Y
> A / Z
> Y/ B
> Y/ C
> Z / D
> Z / E
> F / G
>
> So I would like to get a list, base on reference parent 'A'
> X
> Y
> Z
> B
> C
> D
> E
>
> I have spent a few hours without success. I have seen BOM.ZIP on
> mvps.org/access, but it is too different.
>
> Anybodt has done something similar?
>
>
>


Nov 13 '05 #6
I had a look at google group. Indeed your message from August 19th never
showed up from my newsgroup server. Sorry about that. Thanks for the
revision.

Signed:
Not an ungrateful user. ;o)

"ByteMyzer" <sb*@nospam.news.chi.sbcglobal.net> wrote in message
news:q5*****************@newssvr33.news.prodigy.co m...
Hey, this isn't an indication if ingratitude, now is it? You never
responded to the question I asked. Geez, try to help and run into
ungrateful users.

One more try. Here is a sub that does what you need, with Table1 defining
the Parent and Subjob relationships and Table2 with the following two
fields: Subjob (text field) and LLC (Number field, Long Integer). (LLC - Low Level Code)

'---------------------<< begin code>>---------------------
Public Sub Explosion(Parent As String)

Dim LLC As Long, qd As QueryDef

Set qd = CurrentDb.CreateQueryDef("")

qd.SQL = "INSERT INTO Table2 (Subjob, LLC) " _
& "SELECT Table1.Subjob, 1 FROM Table1 " _
& "WHERE Table1.Parent='" & Parent & "';"
qd.Execute

If qd.RecordsAffected Then
Do
LLC = LLC + 1
qd.SQL = "INSERT INTO Table2 (Subjob, LLC) " _
& "SELECT Table1.Subjob, " & LLC + 1 _
& " FROM Table1 WHERE Table1.Parent IN " _
& "(SELECT T2.Subjob FROM Table2 AS T2 " _
& "WHERE T2.LLC=" & LLC & ";);"
qd.Execute
Loop Until qd.RecordsAffected = 0
End If

qd.Close
Set qd = Nothing

End Sub
'----------------------<< end code>>----------------------

"Saintor" <sa******@REMOVETHIShotmail.com> wrote in message
news:Uw********************@wagner.videotron.net.. .
Since I did not find on internet (surprisingly), here is my solution ( for
the next seeker) to have an exploded list, based on a multi-level structure.
Relatively simple. Table1 is the one with jobs and subjobs and table2 is the target, with a list of all related subjobs and level found.

Public Sub Explode(newparent As String)
Dim db As DAO.database, rs As DAO.Recordset, iLevel As Integer

DoCmd.SetWarnings False

iLevel = 0

Set db = CurrentDb
Set rs = db.openrecordset("Select subjob from table1 where job='" &
newparent & "'")

If rs.RecordCount = 0 Then GoTo GetOut

iLevel = iLevel + 1
DoCmd.RunSQL "INSERT INTO table2 ( Subjob ) SELECT Subjob FROM Table1

WHERE
Job='" & newparent & "'"
DoCmd.RunSQL "UPDATE table2 SET table2.[Level] = " & iLevel & " WHERE
(((table2.Level)=0));"

rs.Close

R1:

Set rs = db.openrecordset("Select subjob from table2 where Level=" &

iLevel)
iLevel = iLevel + 1

If rs.RecordCount = 0 Then GoTo GetOut

rs.MoveFirst
Do Until rs.EOF
newparent = rs!subjob
DoCmd.RunSQL "INSERT INTO table2 ( Subjob ) SELECT Subjob FROM Table1

WHERE
Job='" & newparent & "'"
DoCmd.RunSQL "UPDATE table2 SET table2.[Level] = " & iLevel & " WHERE
(((table2.Level)=0));"
rs.MoveNext
Loop

rs.Close
GoTo R1

GetOut:
DoCmd.SetWarnings True
Set rs = Nothing
Set db = Nothing

End Sub
"Saintor" <sa******@hotmail.com> wrote in message
news:2f**************************@posting.google.c om...
Thanks for replying. However I get an error (3075). I suspect that
the array is limited by the maximum number of characters allowed for a
string (255) variable exBuffer in this case. Any solution to this?

"ByteMyzer" <sb*@nospam.news.chi.sbcglobal.net> wrote in message

news:<%e*****************@newssvr15.news.prodigy.c om>...
> The following VBA function returns an array such as you describe,

from a > table named Table1, with the fields Parent and Subjob:
>
> '---------------<< Begin Code >>---------------
> Public Function Explosion(Parent As String) As Variant
>
> Dim exPos As Long, exBuffer As String
> Dim rs As Recordset
> ReDim exTemp(0) As String
>
> exBuffer = "'" & Parent & "'"
> Do
> Set rs = CurrentDb.OpenRecordset("SELECT Subjob FROM Table1

WHERE
> Parent In (" & exBuffer & ") ORDER BY Subjob;")
> If rs.RecordCount = 0 Then rs.Close: Exit Do
> exBuffer = ""
> Do While Not rs.EOF
> exBuffer = exBuffer & IIf(exBuffer > "", ",'", "'") &

rs!Subjob
> & "'"
> rs.MoveNext
> Loop
> rs.Close
> exPos = 0
> Do
> If InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) Then
> exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
> InStr(exPos + 1, exBuffer, ",", vbBinaryCompare) - exPos - 3)
> Else
> exTemp(UBound(exTemp)) = Mid(exBuffer, exPos + 2,
> Len(exBuffer) - exPos - 2)
> End If
> exPos = InStr(exPos + 1, exBuffer, ",", vbBinaryCompare)
> ReDim Preserve exTemp(UBound(exTemp) + 1)
> Loop Until exPos = 0
> Loop
> If UBound(exTemp) Then ReDim Preserve exTemp(UBound(exTemp) - 1)
>
> Explosion = exTemp
>
> End Function
> '----------------<< End Code >>----------------
>
> For example, if you want to populate an array named MyList with an

explosion
> of "A", as you described, you would use:
> MyList=Explosion("A")
> ...and it would populate MyList thus:
> MyList(0)="X"
> MyList(1)="Y"
> MyList(2)="Z"
> MyList(3)="B"
> MyList(4)="C"
> MyList(5)="D"
> MyList(6)="E"
>
> See if this works for you.
>
>
> "Saintor" <sa******@REMOVETHIShotmail.com> wrote in message
> news:or**********************@wagner.videotron.net ...
> > I have a problem similar as getting a straight list from multi-level > Bills
> > of Material.
> >
> > Instead I have parent jobs and subjobs.
> >
> > Parent / Subjob
> > A / X
> > A / Y
> > A / Z
> > Y/ B
> > Y/ C
> > Z / D
> > Z / E
> > F / G
> >
> > So I would like to get a list, base on reference parent 'A'
> > X
> > Y
> > Z
> > B
> > C
> > D
> > E
> >
> > I have spent a few hours without success. I have seen BOM.ZIP on
> > mvps.org/access, but it is too different.
> >
> > Anybodt has done something similar?
> >
> >
> >



Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Olaf Baeyens | last post by:
I have seen a lot of talk about .NET and C# and stuff, but so far I didn't see any commercial programs yet. Until know, I happen to stumble on some programs that seems to be a .NET program and...
2
by: Randy Harris | last post by:
I am using a table to store temporary information. The application frequently empties and reloads the data in the table from a table bound to the table. The problem is, the app grows like crazy. ...
248
by: Generic Usenet Account | last post by:
As per Google's Usenet archives http://groups.google.com/googlegroups/archive_announce_20.html], the first discussion of the Y2K problem on the Usenet was on January 18 1985...
2
by: James Coe | last post by:
ARGH! Any ideas why this might be happening? The code I'm using comes straight from the example in the VB.NET Help System. All I did was tweak the name= stuff to match my application. Server...
0
by: freshman | last post by:
# test code: http://pyode.sourceforge.net/tutorials/tutorial3.html # #i want selecting object in pyode test code. # what's wrong? # under modify code # see selectObject() function # pyODE...
6
by: pankajs | last post by:
Hello freinds! I m making a game but I m facing a problem that when I click New Game button(defined by me) animation starts. But in the animation keys are not working even the Close button at the...
8
by: =?Utf-8?B?QmVu?= | last post by:
Hi, I have a couple of questions about the proper design of classes. I'll use a simple Customer class for my question. 1) Lets say that I have this Customer class like I said, and I want to...
0
by: xtopia | last post by:
Hi Guys I'm a novice access VBA programmer. I’m trying to write a nested query to explode the bill of material. But the BOM table has more than 20 levels. It’s really redundant and annoying to...
1
by: xtopia | last post by:
Hi Guys I'm a novice access VBA programmer. I’m trying to write a nested query to explode the bill of material. But the BOM table has more than 20 levels. It’s really redundant and annoying to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.