Variables unknown

RonnieODIN

Registered User.
Local time
Today, 19:08
Joined
Jun 15, 2012
Messages
46
Hi,

I am having some trouble getting my report work correctly.

I have a report, repKomp, based on some sub-reports which are based on queries. I have two criterias for the queries - the same two for all - saying that two FK's must be filtered on a variable, Mask and Komp respectively.

I want to open the report when clicking a button on my form. The variables are also defined here.

The report is opened but first I have to reassign the values for the variables twice for each sub-report. I do not get why the report doesn't work.

Hope that someone could please help me.

My code is:

Code:
    Mask = Me.MaskineID
    Komp = Me.KtlFane45 + 1
    Me!Tekst143 = Mask
    Me!Tekst145 = Komp
    DoCmd.OpenReport "repKomp", acViewPreview, , "MaskineID = [Forms]![frmInfoMaskiner]![MaskineID]", acDialog
 
No, the two issues are not related.

Good question. I made the criteria relate to the field and control on my form instead and it worked.

Just now I am shown the tables twice?
 
Alright, just checking. ;)

I don't understand what you mean by the tables are being shown twice. Can you elaborate. Or show us a screenshot.
 
Here is an image of how the report looks like in design view and in preview. I do not get why the records are shown twice when I have the fields and subs only once.
 

Attachments

  • report.jpg
    report.jpg
    92.9 KB · Views: 90
You will need to read more about reports to understand how it works. It is simply repeating per value. Look at the record source of your main report.
 
I solved the problem by deleting the record source for the main report.
 

Users who are viewing this thread

Back
Top Bottom