Solved Subreport GoToRecord (1 Viewer)

JRPMD

Registered User.
Local time
Today, 01:59
Joined
Nov 24, 2012
Messages
52
Hello , I have three forms , based in the same table , in order to show the first , second and third records.
The following code in each form works properly:

Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm "Form 1", acNormal
DoCmd.GoToRecord acDataForm, "Form 1", acGoTo, 1
End Sub

Each one is going to record 1 , 2 and 3 , this numbers given by an autonumeric field.
Now I want to see them as subforms in a report , but it fails and only the first record is showed in all the subforms.
I tried with subreports in a report , but doesn´t work .
As reports with this code retrieve the records I want , but no as subreports.
Can you give some idea about this?
Thanks in advance.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:59
Joined
May 7, 2009
Messages
19,232
do you have Autonumber field in your table?
You need to add one (ID).
make your Report bound to your table.
the subreport must have a Link Master/Child Fields (ID).
 

Rene vK

Member
Local time
Today, 10:59
Joined
Mar 3, 2013
Messages
123
do you have Autonumber field in your table?
You need to add one (ID).
make your Report bound to your table.
the subreport must have a Link Master/Child Fields (ID).
Each one is going to record 1 , 2 and 3 , this numbers given by an autonumeric field.
 

JRPMD

Registered User.
Local time
Today, 01:59
Joined
Nov 24, 2012
Messages
52
do you have Autonumber field in your table?
You need to add one (ID).
make your Report bound to your table.
the subreport must have a Link Master/Child Fields (ID).
Thanks for your answer. The tables have an Id wich is an autonumeric field . And I create a relationship between the tables.
It works properly in subforms and I can see records 1, 2 o 3 using this code , but not if there are subforms or subreports in a report , in wich they show the first record in all subforms.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:59
Joined
Feb 19, 2002
Messages
43,223
There is something off about your table design. One record shouldn't have a meaning different from other records.
 

Users who are viewing this thread

Top Bottom