Shifting textboxes on report after hidden

L

Loren

I am attempting to shift some textboxes and their associated labels to
the left on a report. Currently, I have them only appearing when a
True value is encountered by utilizing the code: txt1.visible = Nz
([txt1], 0)<>)

Each of my textboxes is labeled txt1, txt2, txt3 etc...

I would appreciate any help, as this is the final step in a project I
have built. Thank you.
 
D

Duane Hookom

Hi Loren,
If they are not visible, then why move them?
If you really need this, then share your existing code that sets the visible
property.
 
L

Loren

Hi Loren,
If they are not visible, then why move them?
If you really need this, then share your existing code that sets the visible
property.
--
Duane Hookom
Microsoft Access MVP



Loren said:
I am attempting to shift some textboxes and their associated labels to
the left on a report. Currently, I have them only appearing when a
True value is encountered by utilizing the code: txt1.visible = Nz
([txt1], 0)<>)
Each of my textboxes is labeled txt1, txt2, txt3 etc...
I would appreciate any help, as this is the final step in a project I
have built. Thank you.- Hide quoted text -

- Show quoted text -

I wanted them to not only hide, but to shift left since this is the
action I have the checkboxes currently performing in the "Details"
section of the report and these textboxes are located in the "Exercise
Type Header". I think the problem is that I have an expression tied in
to this that produces a sum of the number of times a unit has run an
exercise, but am not quite sure how to set up the query to resolve
this issue. The expression code is: Sum(IIf([ExerciseDetails_1HS],
1,0))
This is the code I am using for the checkboxes, and then the code used
to shift them left eliminating the white space.

Me("chk" & 1).Visible = (Me("chk" & 1) = True)

Dim IngLeft as Long
Dim intcount as Integer
Dim intwidth As Integer 'width of one control
Dim ctl as Control
IngLeft = Me ("chk1"). Left
intwdith = 1000
For intCount = 1 To 41
Set ctl = Me ("chk" & intCount)
If ctl. Value = True Then
ctl. visible = True
'move the checkbox
ctl. Left = Ing Left
'move the label
ctl. Controls(0). Left = IngLeft
'set the next horizontal position
IngLeft = IngLeft + intwidth
Else
ctl.visible = False
End If
Next
 
D

Duane Hookom

I am a bit confused. Apparently you want to move non-hidden controls in
addition to hidden controls. Correct? Are all of these in the same report
section?

I think this might be caused by non-normalized table structures. Could you
provide some background regarding this issue? I think there might be a better
solution but I don't know exactly what you are attempting to accomplish. You
have only told us how you are attempting to accomplish.
--
Duane Hookom
Microsoft Access MVP


Loren said:
Hi Loren,
If they are not visible, then why move them?
If you really need this, then share your existing code that sets the visible
property.
--
Duane Hookom
Microsoft Access MVP



Loren said:
I am attempting to shift some textboxes and their associated labels to
the left on a report. Currently, I have them only appearing when a
True value is encountered by utilizing the code: txt1.visible = Nz
([txt1], 0)<>)
Each of my textboxes is labeled txt1, txt2, txt3 etc...
I would appreciate any help, as this is the final step in a project I
have built. Thank you.- Hide quoted text -

- Show quoted text -

I wanted them to not only hide, but to shift left since this is the
action I have the checkboxes currently performing in the "Details"
section of the report and these textboxes are located in the "Exercise
Type Header". I think the problem is that I have an expression tied in
to this that produces a sum of the number of times a unit has run an
exercise, but am not quite sure how to set up the query to resolve
this issue. The expression code is: Sum(IIf([ExerciseDetails_1HS],
1,0))
This is the code I am using for the checkboxes, and then the code used
to shift them left eliminating the white space.

Me("chk" & 1).Visible = (Me("chk" & 1) = True)

Dim IngLeft as Long
Dim intcount as Integer
Dim intwidth As Integer 'width of one control
Dim ctl as Control
IngLeft = Me ("chk1"). Left
intwdith = 1000
For intCount = 1 To 41
Set ctl = Me ("chk" & intCount)
If ctl. Value = True Then
ctl. visible = True
'move the checkbox
ctl. Left = Ing Left
'move the label
ctl. Controls(0). Left = IngLeft
'set the next horizontal position
IngLeft = IngLeft + intwidth
Else
ctl.visible = False
End If
Next
 
L

Loren

I am a bit confused. Apparently you want to move non-hidden controls in
addition to hidden controls. Correct? Are all of these in the same report
section?

I think this might be caused by non-normalized table structures. Could you
provide some background regarding this issue? I think there might be a better
solution but I don't know exactly what you are attempting to accomplish. You
have only told us how you are attempting to accomplish.
--
Duane Hookom
Microsoft Access MVP



Loren said:
Hi Loren,
If they are not visible, then why move them?
If you really need this, then share your existing code that sets the visible
property.
--
Duane Hookom
Microsoft Access MVP
:
I am attempting to shift some textboxes and their associated labels to
the left on a report. Currently, I have them only appearing when a
True value is encountered by utilizing the code: txt1.visible = Nz
([txt1], 0)<>)
Each of my textboxes is labeled txt1, txt2, txt3 etc...
I would appreciate any help, as this is the final step in a project I
have built. Thank you.- Hide quoted text -
- Show quoted text -
I wanted them to not only hide, but to shift left since this is the
action I have the checkboxes currently performing in the "Details"
section of the report and these textboxes are located in the "Exercise
Type Header". I think the problem is that I have an expression tied in
to this that produces a sum of the number of times a unit has run an
exercise, but am not quite sure how to set up the query to resolve
this issue. The expression code is: Sum(IIf([ExerciseDetails_1HS],
1,0))
This is the code I am using for the checkboxes, and then the code used
to shift them left eliminating the white space.
Me("chk" & 1).Visible = (Me("chk" & 1) = True)
Dim IngLeft as Long
Dim intcount as Integer
Dim intwidth As Integer 'width of one control
Dim ctl as Control
IngLeft = Me ("chk1"). Left
intwdith = 1000
For intCount = 1 To 41
Set ctl = Me ("chk" & intCount)
If ctl. Value = True Then
ctl. visible = True
'move the checkbox
ctl. Left = Ing Left
'move the label
ctl. Controls(0). Left = IngLeft
'set the next horizontal position
IngLeft = IngLeft + intwidth
Else
ctl.visible = False
End If
Next- Hide quoted text -

- Show quoted text -

I have a report that is used to monitor the participation of units
performing exercises. I have 41 units that are being tracked by using
the checkbox. The report is grouped by exercise type with the
applicable dates below across the top are the headers for each unit.
The original issue I had was that 41 headers would not fit across the
screen of one page and since I would never have an exercise with more
than 20 participants I decided to hide the checkboxes that were not
checked and then have them shift left to eliminate white space and
allow better readability.
In this report I wanted to be able to give the user the ability to
quickly know how many times a unit ran a particular exercise. So I
created a textbox with this expression for each unit: Sum(IIf([unit
name],1,0)) It works great, but I run in to the same problem as the
checkboxes...not enough space. I have been able to hide each of the 41
textboxes with the code: txt1.visible = Nz ([txt1], 0)<>) The problem
now is that I can not use a similar code that I used for the
checkboxes to shift all textboxes with a value to the left.
Currently in the query for this report I have date, exercise type, and
the 41 units via checkbox. I hope this makes a little more sense.
Thank you for your quick replies.

Loren
 
D

Duane Hookom

I think I understand however do you have 41 similar fields? Is the report,
the result of a crosstab query? What are the actual significant table and
field names?
--
Duane Hookom
Microsoft Access MVP


Loren said:
I am a bit confused. Apparently you want to move non-hidden controls in
addition to hidden controls. Correct? Are all of these in the same report
section?

I think this might be caused by non-normalized table structures. Could you
provide some background regarding this issue? I think there might be a better
solution but I don't know exactly what you are attempting to accomplish. You
have only told us how you are attempting to accomplish.
--
Duane Hookom
Microsoft Access MVP



Loren said:
On Feb 25, 11:47 am, Duane Hookom <duanehookom@NO_SPAMhotmail.com>
wrote:
Hi Loren,
If they are not visible, then why move them?
If you really need this, then share your existing code that sets the visible
property.
:
I am attempting to shift some textboxes and their associated labels to
the left on a report. Currently, I have them only appearing when a
True value is encountered by utilizing the code: txt1.visible = Nz
([txt1], 0)<>)
Each of my textboxes is labeled txt1, txt2, txt3 etc...
I would appreciate any help, as this is the final step in a project I
have built. Thank you.- Hide quoted text -
- Show quoted text -
I wanted them to not only hide, but to shift left since this is the
action I have the checkboxes currently performing in the "Details"
section of the report and these textboxes are located in the "Exercise
Type Header". I think the problem is that I have an expression tied in
to this that produces a sum of the number of times a unit has run an
exercise, but am not quite sure how to set up the query to resolve
this issue. The expression code is: Sum(IIf([ExerciseDetails_1HS],
1,0))
This is the code I am using for the checkboxes, and then the code used
to shift them left eliminating the white space.
Me("chk" & 1).Visible = (Me("chk" & 1) = True)
Dim IngLeft as Long
Dim intcount as Integer
Dim intwidth As Integer 'width of one control
Dim ctl as Control
IngLeft = Me ("chk1"). Left
intwdith = 1000
For intCount = 1 To 41
Set ctl = Me ("chk" & intCount)
If ctl. Value = True Then
ctl. visible = True
'move the checkbox
ctl. Left = Ing Left
'move the label
ctl. Controls(0). Left = IngLeft
'set the next horizontal position
IngLeft = IngLeft + intwidth
Else
ctl.visible = False
End If
Next- Hide quoted text -

- Show quoted text -

I have a report that is used to monitor the participation of units
performing exercises. I have 41 units that are being tracked by using
the checkbox. The report is grouped by exercise type with the
applicable dates below across the top are the headers for each unit.
The original issue I had was that 41 headers would not fit across the
screen of one page and since I would never have an exercise with more
than 20 participants I decided to hide the checkboxes that were not
checked and then have them shift left to eliminate white space and
allow better readability.
In this report I wanted to be able to give the user the ability to
quickly know how many times a unit ran a particular exercise. So I
created a textbox with this expression for each unit: Sum(IIf([unit
name],1,0)) It works great, but I run in to the same problem as the
checkboxes...not enough space. I have been able to hide each of the 41
textboxes with the code: txt1.visible = Nz ([txt1], 0)<>) The problem
now is that I can not use a similar code that I used for the
checkboxes to shift all textboxes with a value to the left.
Currently in the query for this report I have date, exercise type, and
the 41 units via checkbox. I hope this makes a little more sense.
Thank you for your quick replies.

Loren
 
L

Loren

I think I understand however do you have 41 similar fields? Is the report,
the result of a crosstab query? What are the actual significant table and
field names?
--
Duane Hookom
Microsoft Access MVP



Loren said:
I am a bit confused. Apparently you want to move non-hidden controls in
addition to hidden controls. Correct? Are all of these in the same report
section?
I think this might be caused by non-normalized table structures. Couldyou
provide some background regarding this issue? I think there might be abetter
solution but I don't know exactly what you are attempting to accomplish. You
have only told us how you are attempting to accomplish.
--
Duane Hookom
Microsoft Access MVP
:
On Feb 25, 11:47 am, Duane Hookom <duanehookom@NO_SPAMhotmail.com>
wrote:
Hi Loren,
If they are not visible, then why move them?
If you really need this, then share your existing code that sets the visible
property.
--
Duane Hookom
Microsoft Access MVP
:
I am attempting to shift some textboxes and their associated labels to
the left on a report. Currently, I have them only appearing whena
True value is encountered by utilizing the code: txt1.visible = Nz
([txt1], 0)<>)
Each of my textboxes is labeled txt1, txt2, txt3 etc...
I would appreciate any help, as this is the final step in a project I
have built. Thank you.- Hide quoted text -
- Show quoted text -
I wanted them to not only hide, but to shift left since this is the
action I have the checkboxes currently performing in the "Details"
section of the report and these textboxes are located in the "Exercise
Type Header". I think the problem is that I have an expression tied in
to this that produces a sum of the number of times a unit has run an
exercise, but am not quite sure how to set up the query to resolve
this issue. The expression code is: Sum(IIf([ExerciseDetails_1HS],
1,0))
This is the code I am using for the checkboxes, and then the code used
to shift them left eliminating the white space.
Me("chk" & 1).Visible = (Me("chk" & 1) = True)
Dim IngLeft as Long
Dim intcount as Integer
Dim intwidth As Integer 'width of one control
Dim ctl as Control
IngLeft = Me ("chk1"). Left
intwdith = 1000
For intCount = 1 To 41
Set ctl = Me ("chk" & intCount)
If ctl. Value = True Then
ctl. visible = True
'move the checkbox
ctl. Left = Ing Left
'move the label
ctl. Controls(0). Left = IngLeft
'set the next horizontal position
IngLeft = IngLeft + intwidth
Else
ctl.visible = False
End If
Next- Hide quoted text -
- Show quoted text -
I have a report that is used to monitor the participation of units
performing exercises. I have 41 units that are being tracked by using
the checkbox. The report is grouped by exercise type with the
applicable dates below across the top are the headers for each unit.
The original issue I had was that 41 headers would not fit across the
screen of one page and since I would never have an exercise with more
than 20 participants I decided to hide the checkboxes that were not
checked and then have them shift left to eliminate white space and
allow better readability.
In this report I wanted to be able to give the user the ability to
quickly know how many times a unit ran a particular exercise. So I
created a textbox with this expression for each unit: Sum(IIf([unit
name],1,0)) It works great, but I run in to the same problem as the
checkboxes...not enough space. I have been able to hide each of the 41
textboxes with the code: txt1.visible = Nz ([txt1], 0)<>)  The problem
now is that I can not use a similar code that I used for the
checkboxes to shift all textboxes with a value to the left.
Currently in the query for this report I have date, exercise type, and
the 41 units via checkbox. I hope this makes a little more sense.
Thank you for your quick replies.
Loren- Hide quoted text -

- Show quoted text -

They are 41 similar fields. It is not a cross tab query.
The table is broken down like this: ExerciseDetails_ID (Autonumber),
ExerciseDetails_DateofExercise (Text), ExerciseDetails_ExerciseType
(Text), ExerciseDetails_unit name (Yes/No) unit name repeats for each
unit.
 
D

Duane Hookom

I try to work with normalized tables so that I don't have to write a ton of
code to accomplish simple tasks. Can you provide a sample of the 41 field
names? Are these numbered 1 through 41?

I expect I would create a union query to normalize the potentially 41 field
values into potentially 41 records.

--
Duane Hookom
Microsoft Access MVP


Loren said:
I think I understand however do you have 41 similar fields? Is the report,
the result of a crosstab query? What are the actual significant table and
field names?
--
Duane Hookom
Microsoft Access MVP



Loren said:
On Feb 25, 12:37 pm, Duane Hookom <duanehookom@NO_SPAMhotmail.com>
wrote:
I am a bit confused. Apparently you want to move non-hidden controls in
addition to hidden controls. Correct? Are all of these in the same report
section?
I think this might be caused by non-normalized table structures. Could you
provide some background regarding this issue? I think there might be a better
solution but I don't know exactly what you are attempting to accomplish. You
have only told us how you are attempting to accomplish.
:
On Feb 25, 11:47 am, Duane Hookom <duanehookom@NO_SPAMhotmail.com>
wrote:
Hi Loren,
If they are not visible, then why move them?
If you really need this, then share your existing code that sets the visible
property.
:
I am attempting to shift some textboxes and their associated labels to
the left on a report. Currently, I have them only appearing when a
True value is encountered by utilizing the code: txt1.visible = Nz
([txt1], 0)<>)
Each of my textboxes is labeled txt1, txt2, txt3 etc...
I would appreciate any help, as this is the final step in a project I
have built. Thank you.- Hide quoted text -
- Show quoted text -
I wanted them to not only hide, but to shift left since this is the
action I have the checkboxes currently performing in the "Details"
section of the report and these textboxes are located in the "Exercise
Type Header". I think the problem is that I have an expression tied in
to this that produces a sum of the number of times a unit has run an
exercise, but am not quite sure how to set up the query to resolve
this issue. The expression code is: Sum(IIf([ExerciseDetails_1HS],
1,0))
This is the code I am using for the checkboxes, and then the code used
to shift them left eliminating the white space.
Me("chk" & 1).Visible = (Me("chk" & 1) = True)
Dim IngLeft as Long
Dim intcount as Integer
Dim intwidth As Integer 'width of one control
Dim ctl as Control
IngLeft = Me ("chk1"). Left
intwdith = 1000
For intCount = 1 To 41
Set ctl = Me ("chk" & intCount)
If ctl. Value = True Then
ctl. visible = True
'move the checkbox
ctl. Left = Ing Left
'move the label
ctl. Controls(0). Left = IngLeft
'set the next horizontal position
IngLeft = IngLeft + intwidth
Else
ctl.visible = False
End If
Next- Hide quoted text -
- Show quoted text -
I have a report that is used to monitor the participation of units
performing exercises. I have 41 units that are being tracked by using
the checkbox. The report is grouped by exercise type with the
applicable dates below across the top are the headers for each unit.
The original issue I had was that 41 headers would not fit across the
screen of one page and since I would never have an exercise with more
than 20 participants I decided to hide the checkboxes that were not
checked and then have them shift left to eliminate white space and
allow better readability.
In this report I wanted to be able to give the user the ability to
quickly know how many times a unit ran a particular exercise. So I
created a textbox with this expression for each unit: Sum(IIf([unit
name],1,0)) It works great, but I run in to the same problem as the
checkboxes...not enough space. I have been able to hide each of the 41
textboxes with the code: txt1.visible = Nz ([txt1], 0)<>) The problem
now is that I can not use a similar code that I used for the
checkboxes to shift all textboxes with a value to the left.
Currently in the query for this report I have date, exercise type, and
the 41 units via checkbox. I hope this makes a little more sense.
Thank you for your quick replies.
Loren- Hide quoted text -

- Show quoted text -

They are 41 similar fields. It is not a cross tab query.
The table is broken down like this: ExerciseDetails_ID (Autonumber),
ExerciseDetails_DateofExercise (Text), ExerciseDetails_ExerciseType
(Text), ExerciseDetails_unit name (Yes/No) unit name repeats for each
unit.
 
L

Loren

I try to work with normalized tables so that I don't have to write a ton of
code to accomplish simple tasks. Can you provide a sample of the 41 field
names? Are these numbered 1 through 41?

I expect I would create a union query to normalize the potentially 41 field
values into potentially 41 records.

--
Duane Hookom
Microsoft Access MVP



Loren said:
I think I understand however do you have 41 similar fields? Is the report,
the result of a crosstab query? What are the actual significant table and
field names?
--
Duane Hookom
Microsoft Access MVP
:
On Feb 25, 12:37 pm, Duane Hookom <duanehookom@NO_SPAMhotmail.com>
wrote:
I am a bit confused. Apparently you want to move non-hidden controls in
addition to hidden controls. Correct? Are all of these in the samereport
section?
I think this might be caused by non-normalized table structures. Could you
provide some background regarding this issue? I think there might be a better
solution but I don't know exactly what you are attempting to accomplish. You
have only told us how you are attempting to accomplish.
--
Duane Hookom
Microsoft Access MVP
:
On Feb 25, 11:47 am, Duane Hookom <duanehookom@NO_SPAMhotmail.com>
wrote:
Hi Loren,
If they are not visible, then why move them?
If you really need this, then share your existing code that sets the visible
property.
--
Duane Hookom
Microsoft Access MVP
:
I am attempting to shift some textboxes and their associatedlabels to
the left on a report. Currently, I have them only appearing when a
True value is encountered by utilizing the code: txt1.visible = Nz
([txt1], 0)<>)
Each of my textboxes is labeled txt1, txt2, txt3 etc...
I would appreciate any help, as this is the final step in a project I
have built. Thank you.- Hide quoted text -
- Show quoted text -
I wanted them to not only hide, but to shift left since this is the
action I have the checkboxes currently performing in the "Details"
section of the report and these textboxes are located in the "Exercise
Type Header". I think the problem is that I have an expression tied in
to this that produces a sum of the number of times a unit has run an
exercise, but am not quite sure how to set up the query to resolve
this issue. The expression code is: Sum(IIf([ExerciseDetails_1HS],
1,0))
This is the code I am using for the checkboxes, and then the code used
to shift them left eliminating the white space.
Me("chk" & 1).Visible = (Me("chk" & 1) = True)
Dim IngLeft as Long
Dim intcount as Integer
Dim intwidth As Integer 'width of one control
Dim ctl as Control
IngLeft = Me ("chk1"). Left
intwdith = 1000
For intCount = 1 To 41
Set ctl = Me ("chk" & intCount)
If ctl. Value = True Then
ctl. visible = True
'move the checkbox
ctl. Left = Ing Left
'move the label
ctl. Controls(0). Left = IngLeft
'set the next horizontal position
IngLeft = IngLeft + intwidth
Else
ctl.visible = False
End If
Next- Hide quoted text -
- Show quoted text -
I have a report that is used to monitor the participation of units
performing exercises. I have 41 units that are being tracked by using
the checkbox. The report is grouped by exercise type with the
applicable dates below across the top are the headers for each unit.
The original issue I had was that 41 headers would not fit across the
screen of one page and since I would never have an exercise with more
than 20 participants I decided to hide the checkboxes that were not
checked and then have them shift left to eliminate white space and
allow better readability.
In this report I wanted to be able to give the user the ability to
quickly know how many times a unit ran a particular exercise. So I
created a textbox with this expression for each unit: Sum(IIf([unit
name],1,0)) It works great, but I run in to the same problem as the
checkboxes...not enough space. I have been able to hide each of the 41
textboxes with the code: txt1.visible = Nz ([txt1], 0)<>)  The problem
now is that I can not use a similar code that I used for the
checkboxes to shift all textboxes with a value to the left.
Currently in the query for this report I have date, exercise type, and
the 41 units via checkbox. I hope this makes a little more sense.
Thank you for your quick replies.
Loren- Hide quoted text -
- Show quoted text -
They are 41 similar fields. It is not a cross tab query.
The table is broken down like this: ExerciseDetails_ID   (Autonumber),
ExerciseDetails_DateofExercise (Text), ExerciseDetails_ExerciseType
(Text), ExerciseDetails_unit name (Yes/No) unit name repeats for each
unit.- Hide quoted text -

- Show quoted text -

Thank you for your help Duane, my client wanted to go in a slightly
different direction, so this issue I have been banging my head against
the wall on is no more.

Loren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top