mcdhappy80
Registered User.
- Local time
- Today, 06:20
- Joined
- Jun 22, 2009
- Messages
- 347
Code loads value in Preview, but value doesn't print
I have a master report which I open. On that report there are 4 sub reports.
In OnLoad event of a master report there is this code:
So basically this code fills two text field controls with data.
The master report opens a form and this code is assigned to button on form:
The problem is this.
When i open master form in Normal mode the required data for the two fields is there. When I preview it in print mode it isn't there.
The reason I'm opening this report in Print Preview mode is it doesn't look good in Normal preview mode. Some of the labels and text fields on sub reports don't display as they should.
Why is this?
How do I fix it?
Thank You.
I have a master report which I open. On that report there are 4 sub reports.
In OnLoad event of a master report there is this code:
Code:
Private Sub Report_Load()
'Punjenje polja txtCasovaNedeljno
Dim casDn As Integer
Dim casNe As Integer
casDn = CInt(Me.subRepUgovorORadu1.Report![txtCasovaDnevno])
casNe = casDn * 5
Me.subRepUgovorORadu1.Report![txtCasovaNedeljno] = CStr(casNe)
'Punjenje polja txtDirektor
On Error GoTo Poruka
Dim rs As DAO.Recordset
Dim direktor As String
Dim strSql As String
strSql = "SELECT [tblZaposleni].[txtIme] & ' ' & [tblZaposleni].[txtPrezime] As Direktor " _
& "FROM tblPoslovi INNER JOIN tblZaposleni ON tblPoslovi.intPosaoID = tblZaposleni.intPosloviID " _
& "WHERE intPosloviID = 1;"
Set rs = CurrentDb.OpenRecordset(strSql)
direktor = rs.Fields("Direktor").Value
rs.Close
Set rs = Nothing
Me.subRepUgovorORadu4.Report![txtDirektor] = direktor
Exit Sub
Poruka:
Me.subRepUgovorORadu4.Report![txtDirektor] = "Unesite direktora"
End Sub
The master report opens a form and this code is assigned to button on form:
Code:
Private Sub btnRepUgovorORaduFinal_Click()
DoCmd.OpenReport "repUgovorORaduFinal", acViewPreview, "qryUgovor_frmPregledUgovor", "[qryUgovor_frmPregledUgovor]![intUgovorID]=" & [Forms]![frmUgovorPregled]![intUgovorID]
DoCmd.PrintOut acSelection, , , acHigh,4
End Sub
When i open master form in Normal mode the required data for the two fields is there. When I preview it in print mode it isn't there.
The reason I'm opening this report in Print Preview mode is it doesn't look good in Normal preview mode. Some of the labels and text fields on sub reports don't display as they should.
Why is this?
How do I fix it?
Thank You.
Last edited: