473,804 Members | 3,182 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Information not displaying on Access Report

I'm using VBA to dynamically add rows of textboxes to a Report, then
assign values to those textboxes. The values are definitely being
assigned as I can MsgBox them afterward and the values come up, but
they are NOT actually showing on the Report. Here's the code:

Private Sub Command0_Click( )

Dim NewTextBox As TextBox

DoCmd.OpenRepor t "UserReport ", acViewDesign

X = 1
BoxTop = 480
NextRow = 420

For r = #7/30/2008# To #8/7/2008#
'Day
Set NewTextBox =
Controls.Applic ation.CreateRep ortControl("Use rReport", acTextBox)
With NewTextBox
.Name = "Day" & X
.Top = BoxTop
.Left = 120
.Width = 540
.Height = 300
.FontSize = 10
.FontName = "Arial"
.BorderStyle = fmBorderStyleSi ngle
.SpecialEffect = fmSpecialEffect Flat
End With

X = X + 1
BoxTop = BoxTop + NextRow

Next r

DoCmd.OpenRepor t "UserReport ", acViewPreview

Y = 1

For r = #7/30/2008# To #8/7/2008#

ThsWkDy = Weekday(r)
Select Case (ThsWkDy)

Case 1
WkDy = "SUN"
Case 2
WkDy = "MON"
Case 3
WkDy = "TUE"
Case 4
WkDy = "WED"
Case 5
WkDy = "THU"
Case 6
WkDy = "FRI"
Case 7
WkDy = "SAT"
End Select
Reports("UserRe port")("Day" & Y) = WkDy

Y = Y + 1

Next r

End Sub

The form comes up in Print Preview showing ONLY the Labels I've saved
it with for headers. How do I get the assigned values to show??
Aug 7 '08 #1
1 1465
Several Things, Jeff

1 You shoud delare your variables. Use the Option Explicit at the top of
any module. Much more likely to pick up errors.
2 You can't ( so I believe) set the controsource on a report once it has
started printing.
3) Once you have created your report, you can't do it again unless you
dont save your report as the controls are already defined

Sorry I am usink AK2 so some of the border style commands aren't the same

Try

Option Compare Database
Option Explicit

Private Sub Command0_Click( )

Dim NewTextBox As TextBox
Dim X As Integer
Dim BoxTop As Long, NextRow As Long, r As Long, Y As Long
Dim ThsWkDy As Integer
Dim WkDy As String
Dim FldName As String

DoCmd.OpenRepor t "Report1", acViewDesign

X = 1
BoxTop = 480
NextRow = 420

For r = #7/30/2008# To #8/7/2008#
'Day
Set NewTextBox = Controls.Applic ation.CreateRep ortControl("Rep ort1",
acTextBox)
With NewTextBox
.Name = "Day" & X
.Top = BoxTop
.Left = 120
.Width = 540
.Height = 300
.FontSize = 10
.FontName = "Arial"
.BorderStyle = 1 '*******
.SpecialEffect = 2 '**********
End With

X = X + 1
BoxTop = BoxTop + NextRow

Next r

'DoCmd.OpenRepo rt "Report1", acViewPreview '***********

Y = 1

For r = #7/30/2008# To #8/7/2008#

ThsWkDy = Weekday(r)
Select Case (ThsWkDy)

Case 1
WkDy = "SUN"
Case 2
WkDy = "MON"
Case 3
WkDy = "TUE"
Case 4
WkDy = "WED"
Case 5
WkDy = "THU"
Case 6
WkDy = "FRI"
Case 7
WkDy = "SAT"
End Select

FldName = "Day" & Y

Reports!Report1 .Controls(FldNa me).ControlSour ce = WkDy
'*************

Y = Y + 1

Next r

End Sub
Phil
<je************ ***@cox.comwrot e in message
news:f8******** *************** ***********@j22 g2000hsf.google groups.com...
I'm using VBA to dynamically add rows of textboxes to a Report, then
assign values to those textboxes. The values are definitely being
assigned as I can MsgBox them afterward and the values come up, but
they are NOT actually showing on the Report. Here's the code:

Private Sub Command0_Click( )

Dim NewTextBox As TextBox

DoCmd.OpenRepor t "UserReport ", acViewDesign

X = 1
BoxTop = 480
NextRow = 420

For r = #7/30/2008# To #8/7/2008#
'Day
Set NewTextBox =
Controls.Applic ation.CreateRep ortControl("Use rReport", acTextBox)
With NewTextBox
.Name = "Day" & X
.Top = BoxTop
.Left = 120
.Width = 540
.Height = 300
.FontSize = 10
.FontName = "Arial"
.BorderStyle = fmBorderStyleSi ngle
.SpecialEffect = fmSpecialEffect Flat
End With

X = X + 1
BoxTop = BoxTop + NextRow

Next r

DoCmd.OpenRepor t "UserReport ", acViewPreview

Y = 1

For r = #7/30/2008# To #8/7/2008#

ThsWkDy = Weekday(r)
Select Case (ThsWkDy)

Case 1
WkDy = "SUN"
Case 2
WkDy = "MON"
Case 3
WkDy = "TUE"
Case 4
WkDy = "WED"
Case 5
WkDy = "THU"
Case 6
WkDy = "FRI"
Case 7
WkDy = "SAT"
End Select
Reports("UserRe port")("Day" & Y) = WkDy

Y = Y + 1

Next r

End Sub

The form comes up in Print Preview showing ONLY the Labels I've saved
it with for headers. How do I get the assigned values to show??

Aug 8 '08 #2

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

Similar topics

2
2362
by: Russ | last post by:
I've got a report that puts dates at the top of columns and the user is prompted to enter a beginning date when the report is opened. That date is put in a textbox in the first column like this: =DateValue() Then the next columns are textboxes that add 7 to the previous column for the date display of the next week like this: =+7
5
2227
by: Robert | last post by:
Hello Accessors I have some reports created in Access that are very good for what they do. However, it seems to me that when you are displaying information you don't need to print out that a printer-friendly report is not the best way to go. So, I tried converting one of my Access reports to an Access form. I selected the continuous view to allow displaying multple records but when I went to define my sorting and grouping there was none...
3
3766
by: Mike Turco | last post by:
I have an Access database that holds a catalog and one of the fields contains the HTML for the web page. The HTML code is very simple. I would like to be able to display that HTML output on an access report. Is there some kind of control that I can embed into the report so that I can see that HTML? Thanks, Mike
1
976
by: ATroy | last post by:
Hello: I've created a strongly typed dataset which I know has rows of information but the information in the dataset isn't displayed on the report form. All that are visible are the report buttons and the column headings. Any suggestions on what I should be focusing on or what I'm missing? Thanks, AT
2
1504
by: afr0ninja | last post by:
Hello! I'm fairly new to access, but I'm starting to get the hang of it. This will be a bit lengthy but hopefully it'll have enough information for some kind soul to help me out. I'm currently working on a database where I export data from another program, import the data into access and then run various queries and what not to generate information needed for business planning. I can't link directly to the existing program, so I need...
3
12410
by: Coll | last post by:
I have a report that I run every quarter. When I opened it this quarter, one of the subreports is not displaying. No error message - just nothing displays where the subreport data should be. If you run the subreport on its own, it displays fine. It just won't display on the main report. I tried deleting and readding the subreport. No luck. There are other subreports on the main one and they are acting fine. Any ideas? (Using Access 2000)....
1
1326
by: mmelady | last post by:
Hello everyone, I am a first time user of The Scripts (although I have taken many useful tidbits back to my desk from other discussions). I am currently developing a database that will track sales performance against forecasts. Forecasts and buy plans are entered through forms into static tables. Actual sales data, including sales, weeks of stock, and inventory OH + OO is loaded in weekly using a macro. The information comes out of...
0
1549
by: Kumba | last post by:
Hi all, Working on a pretty fancy access report that prints out a schedule of events in a two-column format, I've stumbled across the need for displaying formatted text into a field. Since I'm using Access 2000, it lacks the ability to do this natively, so I was wondering if anyone had a solution. I've made use of one of the controls of Lebans.com (TextWidthHeight one, rather spiffy), but it seems the RTF display controls there are for...
2
1256
by: gildward | last post by:
I am using MS Access 2003 and trying to format a report so that after each group, a page is inserted that has some detailed information on it, and I want the page to not show the page header and page footer on it. What I have tried to do is use the forcenewpage method on the group footer to create a new page at the end of each group and this works fine. The only thing I can't figure out how to do is to stop the page header and the page footer...
0
9577
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10569
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.