Is there a better way to "Requery" this...?

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Graham Mandeno (MVP) helped me out w/ the CASE statement below (which works
fine).

However, I now realize that I have 2 more questions though ... hopefully
someone can help me out and provide me some pointers.

Below is the code I currently have (I added a bunch of requeries...)

Essentially, I have a bunch of "boxes" on a form (no text -- they are the
basis for a Balanced Scorecard) which colors tell the users where "attention
needs to be paid".

For testing purposes, I have a subform where I change the value. In this
subform I want the color changes appears immediately and also tab from one
textbox to the next.

My 2 questions are below the VBA code:


*******************
Option Compare Database

Private Sub SetColors(c As Control)
Select Case c
Case Is = 0: c.BackColor = 16777215 'white
Case Is <= 25: c.BackColor = 255 'red
Case Is <= 50: c.BackColor = 33023 'orange
Case Is <= 75: c.BackColor = 65535 'yellow
Case Is <= 100: c.BackColor = 32768 'green
Case Else: c.BackColor = 8421504 'gray
End Select
End Sub

Private Sub Form_Current()

SetColors Q1D11
SetColors Q2D11
SetColors Q3D11
SetColors Q4D11

SetColors Q1D12
SetColors Q2D12
SetColors Q3D12
SetColors Q4D12

End Sub

Private Sub Q1D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q2D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q3D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q4D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q1D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q2D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q3D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q4D12_AfterUpdate()
Me.Requery
End Sub

*******************


Q1:
Is there a better way to write a REQUERY once instead of putting it into
each individual textbox? I might end up w/ 200 boxes once the Balanced
Scorecard is complete... having the same 3 lines of code seems to be insane.

Q2:
As of now, the REQUERY for the 8 boxes works fine, but the TAB works little
bit strange now.

For instance, when I update the 2nd box (Q2D11 = Quarter 2; Priority "1.1")
and then press TAB, it won't go to "Q3D11". Instead, it jumps back to
"Q1D11".

So, each time I changed a value, I start from the entire beginning using the
TAB. Is there a way to simply just move to the next box?


Thanks,
Tom
 
you're initially setting the colors of the controls on the form's Current
event - in other words, when the form displays a record and each time to
move to another record. the Me.Requery code does not cause the SetColors
procedure to run again. instead, it requeries the form's RecordSource;
normal action in that case is for the cursor to go to the first record, and
first control in the tab order.
suggest you move the multiple SetColors calls into a separate sub, as

Private Sub UpdateControls()

SetColors Q1D11
SetColors Q2D11
SetColors Q3D11
SetColors Q4D11

SetColors Q1D12
SetColors Q2D12
SetColors Q3D12
SetColors Q4D12

End Sub

then call the procedure whenever you need to update the controls' color
settings, as

Private Sub Form_Current()
UpdateControls
End Sub

and yes, you'll need to call the sub in the AfterUpdate event of every
control, if you want to see the colors updated immediately, as

Private Sub Q1D11_AfterUpdate()
UpdateControls
End Sub

etc, etc, etc. i don't know of any way to get around that, if you want to
see the colors change immediately.

hth
 
Hi Tom

Sorry - I've been offline for a while.

The Requery is complete overkill, and is also the cause of your focus
jumping back to the first control.

After updating one control, you need to call SetColors for *only* that
control. So, for example:

Private Sub Q1D11_AfterUpdate()
SetColors Q1D11
End Sub

Also, instead of writing an AfterUpdate event procedure for every control,
you could just use a single one for the *active* control:

Private Function SetActiveControlColors()
SetColors Me.ActiveControl
End Function

Then, for AfterUpdate in the property sheet of each textbox, instead of:
[Event Procedure]
specify:
=SetActiveControlColors()

Note that the procedure must be declared as a Function (not a Sub) to call
from the property sheet.
 
Tina,

haven't had the chance to test this until now.

Works fine. Thanks so much for the info.


Tom
 
Graham:

Thank you for your feedback.

I implemented this and it works great... immediate updating works and proper
tabbing after each update works too.

Last thing though... when I now open the form (as expected) all boxes are
"white" since they're active.

Is there a chance to also "recall" the proper color based on the stored
value?

Tom


Graham Mandeno said:
Hi Tom

Sorry - I've been offline for a while.

The Requery is complete overkill, and is also the cause of your focus
jumping back to the first control.

After updating one control, you need to call SetColors for *only* that
control. So, for example:

Private Sub Q1D11_AfterUpdate()
SetColors Q1D11
End Sub

Also, instead of writing an AfterUpdate event procedure for every control,
you could just use a single one for the *active* control:

Private Function SetActiveControlColors()
SetColors Me.ActiveControl
End Function

Then, for AfterUpdate in the property sheet of each textbox, instead of:
[Event Procedure]
specify:
=SetActiveControlColors()

Note that the procedure must be declared as a Function (not a Sub) to call
from the property sheet.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Tom said:
Graham Mandeno (MVP) helped me out w/ the CASE statement below (which works
fine).

However, I now realize that I have 2 more questions though ... hopefully
someone can help me out and provide me some pointers.

Below is the code I currently have (I added a bunch of requeries...)

Essentially, I have a bunch of "boxes" on a form (no text -- they are the
basis for a Balanced Scorecard) which colors tell the users where "attention
needs to be paid".

For testing purposes, I have a subform where I change the value. In this
subform I want the color changes appears immediately and also tab from one
textbox to the next.

My 2 questions are below the VBA code:


*******************
Option Compare Database

Private Sub SetColors(c As Control)
Select Case c
Case Is = 0: c.BackColor = 16777215 'white
Case Is <= 25: c.BackColor = 255 'red
Case Is <= 50: c.BackColor = 33023 'orange
Case Is <= 75: c.BackColor = 65535 'yellow
Case Is <= 100: c.BackColor = 32768 'green
Case Else: c.BackColor = 8421504 'gray
End Select
End Sub

Private Sub Form_Current()

SetColors Q1D11
SetColors Q2D11
SetColors Q3D11
SetColors Q4D11

SetColors Q1D12
SetColors Q2D12
SetColors Q3D12
SetColors Q4D12

End Sub

Private Sub Q1D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q2D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q3D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q4D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q1D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q2D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q3D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q4D12_AfterUpdate()
Me.Requery
End Sub

*******************


Q1:
Is there a better way to write a REQUERY once instead of putting it into
each individual textbox? I might end up w/ 200 boxes once the Balanced
Scorecard is complete... having the same 3 lines of code seems to be insane.

Q2:
As of now, the REQUERY for the 8 boxes works fine, but the TAB works little
bit strange now.

For instance, when I update the 2nd box (Q2D11 = Quarter 2; Priority "1.1")
and then press TAB, it won't go to "Q3D11". Instead, it jumps back to
"Q1D11".

So, each time I changed a value, I start from the entire beginning using the
TAB. Is there a way to simply just move to the next box?


Thanks,
Tom
 
Hi Tom

Have you removed your Form_Current procedure? It should be calling
SetColors for *all* of the controls. I notice "tina" suggested you move the
code from Form_Current into another procedure called UpdateControls. That's
fine, so long as you then call UpdateControls from Form_Current.

Also, it seems from your JPG that in the future you are going to have many
more controls. Instead of referring to them all by name, you can use a pair
of nested loops, like this:

Dim i1 as integer, i2 as integer
For i1 = 1 to 4
For i2 = 11 to 12
SetColors Me("Q" & i1 & "D" & i2)
Next i2
Next i1

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


Tom said:
Graham:

Thank you for your feedback.

I implemented this and it works great... immediate updating works and proper
tabbing after each update works too.

Last thing though... when I now open the form (as expected) all boxes are
"white" since they're active.

Is there a chance to also "recall" the proper color based on the stored
value?

Tom


Graham Mandeno said:
Hi Tom

Sorry - I've been offline for a while.

The Requery is complete overkill, and is also the cause of your focus
jumping back to the first control.

After updating one control, you need to call SetColors for *only* that
control. So, for example:

Private Sub Q1D11_AfterUpdate()
SetColors Q1D11
End Sub

Also, instead of writing an AfterUpdate event procedure for every control,
you could just use a single one for the *active* control:

Private Function SetActiveControlColors()
SetColors Me.ActiveControl
End Function

Then, for AfterUpdate in the property sheet of each textbox, instead of:
[Event Procedure]
specify:
=SetActiveControlColors()

Note that the procedure must be declared as a Function (not a Sub) to call
from the property sheet.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Tom said:
Graham Mandeno (MVP) helped me out w/ the CASE statement below (which works
fine).

However, I now realize that I have 2 more questions though ... hopefully
someone can help me out and provide me some pointers.

Below is the code I currently have (I added a bunch of requeries...)

Essentially, I have a bunch of "boxes" on a form (no text -- they are the
basis for a Balanced Scorecard) which colors tell the users where "attention
needs to be paid".

For testing purposes, I have a subform where I change the value. In this
subform I want the color changes appears immediately and also tab from one
textbox to the next.

My 2 questions are below the VBA code:


*******************
Option Compare Database

Private Sub SetColors(c As Control)
Select Case c
Case Is = 0: c.BackColor = 16777215 'white
Case Is <= 25: c.BackColor = 255 'red
Case Is <= 50: c.BackColor = 33023 'orange
Case Is <= 75: c.BackColor = 65535 'yellow
Case Is <= 100: c.BackColor = 32768 'green
Case Else: c.BackColor = 8421504 'gray
End Select
End Sub

Private Sub Form_Current()

SetColors Q1D11
SetColors Q2D11
SetColors Q3D11
SetColors Q4D11

SetColors Q1D12
SetColors Q2D12
SetColors Q3D12
SetColors Q4D12

End Sub

Private Sub Q1D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q2D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q3D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q4D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q1D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q2D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q3D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q4D12_AfterUpdate()
Me.Requery
End Sub

*******************


Q1:
Is there a better way to write a REQUERY once instead of putting it into
each individual textbox? I might end up w/ 200 boxes once the Balanced
Scorecard is complete... having the same 3 lines of code seems to be insane.

Q2:
As of now, the REQUERY for the 8 boxes works fine, but the TAB works little
bit strange now.

For instance, when I update the 2nd box (Q2D11 = Quarter 2; Priority "1.1")
and then press TAB, it won't go to "Q3D11". Instead, it jumps back to
"Q1D11".

So, each time I changed a value, I start from the entire beginning
using
the
TAB. Is there a way to simply just move to the next box?


Thanks,
Tom
 
Graham:

Thanks, this works great now... particularly the "for i" function.

Based on this much more efficient process, is there a way to include the
"for i" also into an INSERT statement?

Please see my function [Private Sub Form_Close()] below... here I still have
to list all individual boxes. Using in "for i" in there as well would be
great.

Any pointers as to how I could achieve that?

Tom







Option Compare Database

Private Sub Form_Current()

Dim i1 As Integer, i2 As Integer

'i1 (1 to 4) equals the 4 quarters
'i2 (11 to 12 equal priorities 1.1 and 1.2...
'... increase these numbers to match all priorities...
'... if 1.1 to 1.9 then "For i2 = 11 To 19"
For i1 = 1 To 4
For i2 = 11 To 12
SetColors Me("Q" & i1 & "D" & i2)
Next i2
Next i1

End Sub


Private Sub SetColors(c As Control)

'Here's where the color codes are set
Select Case c
Case Is = 0: c.BackColor = 16777215 'white
Case Is <= 25: c.BackColor = 255 'red
Case Is <= 50: c.BackColor = 33023 'orange
Case Is <= 75: c.BackColor = 65535 'yellow
Case Is <= 100: c.BackColor = 32768 'green
Case Else: c.BackColor = 8421504 'gray
End Select

End Sub


Private Function SetActiveControlColors()

'This requeries only the Active textbox (instead of listing all of them)
SetColors Me.ActiveControl

End Function


Private Sub Form_Close()

Dim strSQL As String

strSQL = "Insert into tblBSCHistory (Q1D11, Q2D11, Q3D11, Q4D11, Q1D12,
Q2D12, Q3D12, Q4D12) " & vbCrLf & _
"VALUES ('" & Me!Q1D11.Value & "', '" & Me!Q2D11.Value & "', '" &
Me!Q3D11.Value & "', '" & Me!Q4D11.Value & "', '" & Me!Q1D12.Value & "', '"
& Me!Q2D12.Value & "', '" & Me!Q3D12.Value & "', '" & Me!Q4D12.Value & "')"

CurrentDb().Execute strSQL, dbFailOnError

Forms!frmBSC.Requery

End Sub



Graham Mandeno said:
Hi Tom

Have you removed your Form_Current procedure? It should be calling
SetColors for *all* of the controls. I notice "tina" suggested you move the
code from Form_Current into another procedure called UpdateControls. That's
fine, so long as you then call UpdateControls from Form_Current.

Also, it seems from your JPG that in the future you are going to have many
more controls. Instead of referring to them all by name, you can use a pair
of nested loops, like this:

Dim i1 as integer, i2 as integer
For i1 = 1 to 4
For i2 = 11 to 12
SetColors Me("Q" & i1 & "D" & i2)
Next i2
Next i1

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


Tom said:
Graham:

Thank you for your feedback.

I implemented this and it works great... immediate updating works and proper
tabbing after each update works too.

Last thing though... when I now open the form (as expected) all boxes are
"white" since they're active.

Is there a chance to also "recall" the proper color based on the stored
value?

Tom


Graham Mandeno said:
Hi Tom

Sorry - I've been offline for a while.

The Requery is complete overkill, and is also the cause of your focus
jumping back to the first control.

After updating one control, you need to call SetColors for *only* that
control. So, for example:

Private Sub Q1D11_AfterUpdate()
SetColors Q1D11
End Sub

Also, instead of writing an AfterUpdate event procedure for every control,
you could just use a single one for the *active* control:

Private Function SetActiveControlColors()
SetColors Me.ActiveControl
End Function

Then, for AfterUpdate in the property sheet of each textbox, instead of:
[Event Procedure]
specify:
=SetActiveControlColors()

Note that the procedure must be declared as a Function (not a Sub) to call
from the property sheet.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Graham Mandeno (MVP) helped me out w/ the CASE statement below (which
works
fine).

However, I now realize that I have 2 more questions though ... hopefully
someone can help me out and provide me some pointers.

Below is the code I currently have (I added a bunch of requeries...)

Essentially, I have a bunch of "boxes" on a form (no text -- they
are
the
basis for a Balanced Scorecard) which colors tell the users where
"attention
needs to be paid".

For testing purposes, I have a subform where I change the value.
In
this
subform I want the color changes appears immediately and also tab
from
one
textbox to the next.

My 2 questions are below the VBA code:


*******************
Option Compare Database

Private Sub SetColors(c As Control)
Select Case c
Case Is = 0: c.BackColor = 16777215 'white
Case Is <= 25: c.BackColor = 255 'red
Case Is <= 50: c.BackColor = 33023 'orange
Case Is <= 75: c.BackColor = 65535 'yellow
Case Is <= 100: c.BackColor = 32768 'green
Case Else: c.BackColor = 8421504 'gray
End Select
End Sub

Private Sub Form_Current()

SetColors Q1D11
SetColors Q2D11
SetColors Q3D11
SetColors Q4D11

SetColors Q1D12
SetColors Q2D12
SetColors Q3D12
SetColors Q4D12

End Sub

Private Sub Q1D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q2D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q3D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q4D11_AfterUpdate()
Me.Requery
End Sub

Private Sub Q1D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q2D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q3D12_AfterUpdate()
Me.Requery
End Sub

Private Sub Q4D12_AfterUpdate()
Me.Requery
End Sub

*******************


Q1:
Is there a better way to write a REQUERY once instead of putting it into
each individual textbox? I might end up w/ 200 boxes once the Balanced
Scorecard is complete... having the same 3 lines of code seems to be
insane.

Q2:
As of now, the REQUERY for the 8 boxes works fine, but the TAB works
little
bit strange now.

For instance, when I update the 2nd box (Q2D11 = Quarter 2; Priority
"1.1")
and then press TAB, it won't go to "Q3D11". Instead, it jumps back to
"Q1D11".

So, each time I changed a value, I start from the entire beginning using
the
TAB. Is there a way to simply just move to the next box?


Thanks,
Tom
 
Hi Tom

I'm not sure that your table is very well designed. I think a table
structure with:
BSC_id
Q_value
D_value
ValueField
would satisfy the normalization police much better, but let's not go there
right now :-)

You can always use For...Next loops to construct anything with an
enumeratable repeating pattern. In the case of your INSERT statement, you
could do something like this:

Dim Q as integer, D as integer, c as Control
Dim sFields as string, sValues as string
For Q = 1 to 4
For D = 11 to 12
Set c = Me("Q" & Q & "D" & D)
sFields = sFields & c.Name & ", "
sValues = sValues & "'" & c.value & "', "
next D
Next Q
' remove the last ", " from both strings
sFields = Left(sFields, Len(sFields) - 2)
sValues = Left(sValues, Len(sValues) - 2)
strSQL = "Insert into tblBSCHistory (" & sFields & ") VALUES (" & sValues &
")"
 
Graham:

As always, thanks!!!

I'll try this tomorrow morning -- I'm sure it'll work great.

Again, thanks,
Tom



Graham Mandeno said:
Hi Tom

I'm not sure that your table is very well designed. I think a table
structure with:
BSC_id
Q_value
D_value
ValueField
would satisfy the normalization police much better, but let's not go there
right now :-)

You can always use For...Next loops to construct anything with an
enumeratable repeating pattern. In the case of your INSERT statement, you
could do something like this:

Dim Q as integer, D as integer, c as Control
Dim sFields as string, sValues as string
For Q = 1 to 4
For D = 11 to 12
Set c = Me("Q" & Q & "D" & D)
sFields = sFields & c.Name & ", "
sValues = sValues & "'" & c.value & "', "
next D
Next Q
' remove the last ", " from both strings
sFields = Left(sFields, Len(sFields) - 2)
sValues = Left(sValues, Len(sValues) - 2)
strSQL = "Insert into tblBSCHistory (" & sFields & ") VALUES (" & sValues &
")"

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


Tom said:
Graham:

Thanks, this works great now... particularly the "for i" function.

Based on this much more efficient process, is there a way to include the
"for i" also into an INSERT statement?

Please see my function [Private Sub Form_Close()] below... here I still have
to list all individual boxes. Using in "for i" in there as well would be
great.

Any pointers as to how I could achieve that?

Tom
 
Graham:

I tried the "for i" loop w/ the INSERT statement... it works like a charm.

Yes, I will have to rethink my table structure a bit and normalize it... not
exactly sure right now as to how I'll do it though.

Graham, I now realize that I still yet another a "final" question...


In the "SetColors Me("Q" & i1 & "D" & i2)", I use the following:
Q = Quarter (i1 will always be 1 to 4)

D = Section Identifier... currently I use only "D", but I may need
additional ones such as "A, B, C, ..., E" etc.

i2 = sequential count per section


So, my question is: How would I also increase the "Section" identifier from
only "D" to "A, B, C, D, ... etc."?

Tom






Graham Mandeno said:
Hi Tom

I'm not sure that your table is very well designed. I think a table
structure with:
BSC_id
Q_value
D_value
ValueField
would satisfy the normalization police much better, but let's not go there
right now :-)

You can always use For...Next loops to construct anything with an
enumeratable repeating pattern. In the case of your INSERT statement, you
could do something like this:

Dim Q as integer, D as integer, c as Control
Dim sFields as string, sValues as string
For Q = 1 to 4
For D = 11 to 12
Set c = Me("Q" & Q & "D" & D)
sFields = sFields & c.Name & ", "
sValues = sValues & "'" & c.value & "', "
next D
Next Q
' remove the last ", " from both strings
sFields = Left(sFields, Len(sFields) - 2)
sValues = Left(sValues, Len(sValues) - 2)
strSQL = "Insert into tblBSCHistory (" & sFields & ") VALUES (" & sValues &
")"

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


Tom said:
Graham:

Thanks, this works great now... particularly the "for i" function.

Based on this much more efficient process, is there a way to include the
"for i" also into an INSERT statement?

Please see my function [Private Sub Form_Close()] below... here I still have
to list all individual boxes. Using in "for i" in there as well would be
great.

Any pointers as to how I could achieve that?

Tom
 
Hi Tom

Boy, you must be going for the record of the number of questions answered on
one thread! :-)

You can't use letters in a For...Next loop, but fortunately it's possible to
convert sequential letters to sequential numbers and vice-versa.

Dim iSection as Integer, sSection as String
For iSection = Asc("A") to Asc("D")
sSection = Chr(iSection)
Debug.Print sSection
Next

The Asc( ) function returns the numeric ASCII code for the first character
in a string.
The Chr( ) function returns the ASCII character corresponding to the given
ASCII code.

You may have come across Chr(13) & Chr(10) (the two characters necessary to
start a new line if text) in query expressions.

Note that the sSection variable above is not really necessary - if you were
just using each letter once, you would simply use Chr(iSection).
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Tom said:
Graham:

I tried the "for i" loop w/ the INSERT statement... it works like a charm.

Yes, I will have to rethink my table structure a bit and normalize it... not
exactly sure right now as to how I'll do it though.

Graham, I now realize that I still yet another a "final" question...


In the "SetColors Me("Q" & i1 & "D" & i2)", I use the following:
Q = Quarter (i1 will always be 1 to 4)

D = Section Identifier... currently I use only "D", but I may need
additional ones such as "A, B, C, ..., E" etc.

i2 = sequential count per section


So, my question is: How would I also increase the "Section" identifier from
only "D" to "A, B, C, D, ... etc."?

Tom






Graham Mandeno said:
Hi Tom

I'm not sure that your table is very well designed. I think a table
structure with:
BSC_id
Q_value
D_value
ValueField
would satisfy the normalization police much better, but let's not go there
right now :-)

You can always use For...Next loops to construct anything with an
enumeratable repeating pattern. In the case of your INSERT statement, you
could do something like this:

Dim Q as integer, D as integer, c as Control
Dim sFields as string, sValues as string
For Q = 1 to 4
For D = 11 to 12
Set c = Me("Q" & Q & "D" & D)
sFields = sFields & c.Name & ", "
sValues = sValues & "'" & c.value & "', "
next D
Next Q
' remove the last ", " from both strings
sFields = Left(sFields, Len(sFields) - 2)
sValues = Left(sValues, Len(sValues) - 2)
strSQL = "Insert into tblBSCHistory (" & sFields & ") VALUES (" &
sValues
&
")"

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


Tom said:
Graham:

Thanks, this works great now... particularly the "for i" function.

Based on this much more efficient process, is there a way to include the
"for i" also into an INSERT statement?

Please see my function [Private Sub Form_Close()] below... here I
still
have
to list all individual boxes. Using in "for i" in there as well
would
 
Back
Top