Can't Populate Unbound Controls on a Report...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I put this question in "Reports" 2 days ago, but had NO answers...

I have an Embedded jpg on a Report. There are Unbound
Controls on the jpg.

I've used a similar jpg on a Form to populate unbound Controls
w/ NO problems.

BUT, trying this on an unbound Report,
I get Error -2147352567 = "You can't assign a value to ths object".

Then , I can't File - Exit Access...except thru the Windows
Task manager.

Any insight welcomed.

TIA - Bob
 
Bob Barnes said:
I put this question in "Reports" 2 days ago, but had NO answers...

I have an Embedded jpg on a Report. There are Unbound
Controls on the jpg.

I've used a similar jpg on a Form to populate unbound Controls
w/ NO problems.

BUT, trying this on an unbound Report,
I get Error -2147352567 = "You can't assign a value to ths object".

Then , I can't File - Exit Access...except thru the Windows
Task manager.

Any insight welcomed.

TIA - Bob

I don't understand what you mean by "Unbound Controls on the jpg", nor
what it could mean to "use a ... jpg ... to populate unbound Controls".
Could you explain, please? And also, post whatever code procedure
you're trying to use that is giving the error.
 
Bob,
What is the purpose of the unbound control on a report. What is the record
source of your report. If you want a field on the report to reference an
unbound field on a form, then you need a text field with an expression as the
control source like:
=Forms![frmReportMenu]![UnboundFieldName]

Use your expression builder to get the correct syntax.

Hope this helps.
 
Dirk - Thank you.

We made a jpg file & then placed unbound controls over the jpg
(to use its formatting - lines, etc,). It goes to a 17-inch printed Report.

We've used the same jpg on a Form Tab with NO problems for
months, & I've done the same for years.

Here'e the Report_Open event...It errors when trying...
BoFlash = !BoFlash

Then, MUST exit Access by the Windows Task Manager.

Private Sub Report_Open(Cancel As Integer)
Dim Z As Database, RS As DAO.Recordset, Q$, R$, L&, M$
Dim RT As DAO.Recordset
On Error GoTo AAA1
Set Z = CurrentDb
Q = "SELECT * FROM PlasCM WHERE PEntry = """ & Forms!frmPlas!GID & """;"
Set RS = Z.OpenRecordset(Q, dbOpenSnapshot)
With RS
If Not .BOF Then
GID = !PEntry
BoFlash = !BoFlash: JBoFlash = !JBoFlash: OvFlash = !OvFlash: HarFlash =
!HarFlash
BoFace = !BoFace: JBoFace = !JBoFace: OvFace = !OvFace: HarFace = !HarFace
BoFlop = !BoFlop: JBoFlop = !JBoFlop: OvFlop = !OvFlop: HarFlop = !HarFlop
BO21LF = !BO21LF: BO22LF = !BO22LF: BO23LF = !BO23LF: BO24LF = !BO24LF
BO41LF = !BO41LF: BO42LF = !BO42LF: BO43LF = !BO43LF: BO44LF = !BO44LF
BO71LF = !BO71LF: BO72LF = !BO72LF: BO73LF = !BO73LF: BO74LF = !BO74LF
BO2ALQ = !BO2ALQ: BO2BLQ = !BO2BLQ: BO2CLQ = !BO2CLQ: BO2DLQ = !BO2DLQ
BO4ALQ = !BO4ALQ: BO4BLQ = !BO4BLQ: BO4CLQ = !BO4CLQ: BO4DLQ = !BO4DLQ
BO7ALQ = !BO7ALQ: BO7BLQ = !BO7BLQ: BO7CLQ = !BO7CLQ: BO7DLQ = !BO7DLQ
BO21RF = !BO21RF: BO22RF = !BO22RF: BO23RF = !BO23RF: BO24RF = !BO24RF
BO41RF = !BO41RF: BO42RF = !BO42RF: BO43RF = !BO43RF: BO44RF = !BO44RF
BO71RF = !BO71RF: BO72RF = !BO72RF: BO73RF = !BO73RF: BO74RF = !BO74RF
BO2ARQ = !BO2ARQ: BO2BRQ = !BO2BRQ: BO2CRQ = !BO2CRQ: BO2DRQ = !BO2DRQ
BO4ARQ = !BO4ARQ: BO4BRQ = !BO4BRQ: BO4CRQ = !BO4CRQ: BO4DRQ = !BO4DRQ
BO7ARQ = !BO7ARQ: BO7BRQ = !BO7BRQ: BO7CRQ = !BO7CRQ: BO7DRQ = !BO7DRQ
AL25Avg = !AL25Avg: AA25Avg = !AA25Avg: AB25Avg = !AB25Avg
AL45Avg = !AL45Avg: AA45Avg = !AA45Avg: AB45Avg = !AB45Avg
AL75Avg = !AL75Avg: AA75Avg = !AA75Avg: AB75Avg = !AB75Avg: AComment =
!AComment
HA21LF = !HA21LF: HA22LF = !HA22LF: HA23LF = !HA23LF: HA24LF = !HA24LF
HA41LF = !HA41LF: HA42LF = !HA42LF: HA43LF = !HA43LF: HA44LF = !HA44LF
HA71LF = !HA71LF: HA72LF = !HA72LF: HA73LF = !HA73LF: HA74LF = !HA74LF
HA2ALR = !HA2ALR: HA2BLR = !HA2BLR: HA2CLR = !HA2CLR: HA2DLR = !HA2DLR
HA4ALR = !HA4ALR: HA4BLR = !HA4BLR: HA4CLR = !HA4CLR: HA4DLR = !HA4DLR
HA7ALR = !HA7ALR: HA7BLR = !HA7BLR: HA7CLR = !HA7CLR: HA7DLR = !HA7DLR
HA21RF = !HA21RF: HA22RF = !HA22RF: HA23RF = !HA23RF: HA24RF = !HA24RF
HA41RF = !HA41RF: HA42RF = !HA42RF: HA43RF = !HA43RF: HA44RF = !HA44RF
HA71RF = !HA71RF: HA72RF = !HA72RF: HA73RF = !HA73RF: HA74RF = !HA74RF
HA2ARR = !HA2ARR: HA2BRR = !HA2BRR: HA2CRR = !HA2CRR: HA2DRR = !HA2DRR
HA4ARR = !HA4ARR: HA4BRR = !HA4BRR: HA4CRR = !HA4CRR: HA4DRR = !HA4DRR
HA7ARR = !HA7ARR: HA7BRR = !HA7BRR: HA7CRR = !HA7CRR: HA7DRR = !HA7DRR
CL25Avg = !CL25Avg: CA25Avg = !CA25Avg: CB25Avg = !CB25Avg
CL45Avg = !CL45Avg: CA45Avg = !CA45Avg: CB45Avg = !CB45Avg
CL75Avg = !CL75Avg: CA75Avg = !CA75Avg: CB75Avg = !CB75Avg: CComment =
!CComment
End If
.Close: Set RS = Nothing: Z.Close: Set Z = Nothing
End With
AAA2:
Exit Sub
AAA1:
Select Case Err
'Case 2185
'Resume Next
Case 3021
Resume Next
Case Else
MsgBox "Error " & Err.Number & " " & Err.Description: Resume AAA2
End Select
End Sub
 
Jackie L - Thank you - Please see my reply to Dirk in this thread.

Bob

Jackie L said:
Bob,
What is the purpose of the unbound control on a report. What is the record
source of your report. If you want a field on the report to reference an
unbound field on a form, then you need a text field with an expression as the
control source like:
=Forms![frmReportMenu]![UnboundFieldName]

Use your expression builder to get the correct syntax.

Hope this helps.

Bob Barnes said:
I put this question in "Reports" 2 days ago, but had NO answers...

I have an Embedded jpg on a Report. There are Unbound
Controls on the jpg.

I've used a similar jpg on a Form to populate unbound Controls
w/ NO problems.

BUT, trying this on an unbound Report,
I get Error -2147352567 = "You can't assign a value to ths object".

Then , I can't File - Exit Access...except thru the Windows
Task manager.

Any insight welcomed.

TIA - Bob
 
Bob Barnes said:
Dirk - Thank you.

We made a jpg file & then placed unbound controls over the jpg
(to use its formatting - lines, etc,). It goes to a 17-inch printed
Report.

We've used the same jpg on a Form Tab with NO problems for
months, & I've done the same for years.

Here'e the Report_Open event...It errors when trying...
BoFlash = !BoFlash

Then, MUST exit Access by the Windows Task Manager.

Private Sub Report_Open(Cancel As Integer)
Dim Z As Database, RS As DAO.Recordset, Q$, R$, L&, M$
Dim RT As DAO.Recordset
On Error GoTo AAA1
Set Z = CurrentDb
Q = "SELECT * FROM PlasCM WHERE PEntry = """ & Forms!frmPlas!GID &
""";" Set RS = Z.OpenRecordset(Q, dbOpenSnapshot)
With RS
If Not .BOF Then
GID = !PEntry
BoFlash = !BoFlash: JBoFlash = !JBoFlash: OvFlash = !OvFlash:
HarFlash = !HarFlash
BoFace = !BoFace: JBoFace = !JBoFace: OvFace = !OvFace: HarFace =
!HarFace BoFlop = !BoFlop: JBoFlop = !JBoFlop: OvFlop = !OvFlop:
HarFlop = !HarFlop BO21LF = !BO21LF: BO22LF = !BO22LF: BO23LF =
!BO23LF: BO24LF = !BO24LF BO41LF = !BO41LF: BO42LF = !BO42LF:
BO43LF = !BO43LF: BO44LF = !BO44LF BO71LF = !BO71LF: BO72LF =
!BO72LF: BO73LF = !BO73LF: BO74LF = !BO74LF BO2ALQ = !BO2ALQ:
BO2BLQ = !BO2BLQ: BO2CLQ = !BO2CLQ: BO2DLQ = !BO2DLQ BO4ALQ =
!BO4ALQ: BO4BLQ = !BO4BLQ: BO4CLQ = !BO4CLQ: BO4DLQ = !BO4DLQ
BO7ALQ = !BO7ALQ: BO7BLQ = !BO7BLQ: BO7CLQ = !BO7CLQ: BO7DLQ =
!BO7DLQ BO21RF = !BO21RF: BO22RF = !BO22RF: BO23RF = !BO23RF:
BO24RF = !BO24RF BO41RF = !BO41RF: BO42RF = !BO42RF: BO43RF =
!BO43RF: BO44RF = !BO44RF BO71RF = !BO71RF: BO72RF = !BO72RF:
BO73RF = !BO73RF: BO74RF = !BO74RF BO2ARQ = !BO2ARQ: BO2BRQ =
!BO2BRQ: BO2CRQ = !BO2CRQ: BO2DRQ = !BO2DRQ BO4ARQ = !BO4ARQ:
BO4BRQ = !BO4BRQ: BO4CRQ = !BO4CRQ: BO4DRQ = !BO4DRQ BO7ARQ =
!BO7ARQ: BO7BRQ = !BO7BRQ: BO7CRQ = !BO7CRQ: BO7DRQ = !BO7DRQ
AL25Avg = !AL25Avg: AA25Avg = !AA25Avg: AB25Avg = !AB25Avg AL45Avg
= !AL45Avg: AA45Avg = !AA45Avg: AB45Avg = !AB45Avg AL75Avg =
!AL75Avg: AA75Avg = !AA75Avg: AB75Avg = !AB75Avg: AComment =
!AComment HA21LF = !HA21LF: HA22LF = !HA22LF: HA23LF = !HA23LF:
HA24LF = !HA24LF HA41LF = !HA41LF: HA42LF = !HA42LF: HA43LF =
!HA43LF: HA44LF = !HA44LF HA71LF = !HA71LF: HA72LF = !HA72LF:
HA73LF = !HA73LF: HA74LF = !HA74LF HA2ALR = !HA2ALR: HA2BLR =
!HA2BLR: HA2CLR = !HA2CLR: HA2DLR = !HA2DLR HA4ALR = !HA4ALR:
HA4BLR = !HA4BLR: HA4CLR = !HA4CLR: HA4DLR = !HA4DLR HA7ALR =
!HA7ALR: HA7BLR = !HA7BLR: HA7CLR = !HA7CLR: HA7DLR = !HA7DLR
HA21RF = !HA21RF: HA22RF = !HA22RF: HA23RF = !HA23RF: HA24RF =
!HA24RF HA41RF = !HA41RF: HA42RF = !HA42RF: HA43RF = !HA43RF:
HA44RF = !HA44RF HA71RF = !HA71RF: HA72RF = !HA72RF: HA73RF =
!HA73RF: HA74RF = !HA74RF HA2ARR = !HA2ARR: HA2BRR = !HA2BRR:
HA2CRR = !HA2CRR: HA2DRR = !HA2DRR HA4ARR = !HA4ARR: HA4BRR =
!HA4BRR: HA4CRR = !HA4CRR: HA4DRR = !HA4DRR HA7ARR = !HA7ARR:
HA7BRR = !HA7BRR: HA7CRR = !HA7CRR: HA7DRR = !HA7DRR CL25Avg =
!CL25Avg: CA25Avg = !CA25Avg: CB25Avg = !CB25Avg CL45Avg = !CL45Avg:
CA45Avg = !CA45Avg: CB45Avg = !CB45Avg CL75Avg = !CL75Avg: CA75Avg =
!CA75Avg: CB75Avg = !CB75Avg: CComment = !CComment End If .Close:
Set RS = Nothing: Z.Close: Set Z = Nothing End With
AAA2:
Exit Sub
AAA1:
Select Case Err
'Case 2185
'Resume Next
Case 3021
Resume Next
Case Else
MsgBox "Error " & Err.Number & " " & Err.Description: Resume AAA2
End Select
End Sub

I don't think this problem has anything to do with the JPG. But I
suspect that the report's Open event is too early to assign a value to
any of the data controls (text boxes, for example) on the report. Try
either (a) using labels instead of text boxes, and setting their
captions instead of values, or else (b) moving all this code to the
Format event of the Report Header or Detail section.
 
Dirk - That was it !!! I moved the code from Report_Open to the
Format event of the Detail section.

THANK you - Bob
 
Back
Top