creating a report from current form and subform???

darksniper

Registered User.
Local time
Today, 10:29
Joined
Sep 4, 2005
Messages
108
edit: I found out that I cannot have a form and a report accessing the table at the same time, what can I do about it if I want to preview current selected record?

I have been having trouble to create a form with a subform, which after you click a button and it would load up the data of that form and subform into the report. Is there a hint or guide, I have the form and I have the report it is just linking them together gives me a headake.

I found that under report filter I need to add "([id] = Forms![formUsers]![id])"
source is the queury that contains records of form and subform.
and under form I have added a button that previews the report. but I get "database engine could not lock table.." when I press on the button.

on_click event code

Code:
Private Sub Command15_Click()
On Error GoTo Err_Command15_Click

    Dim stDocName As String

    stDocName = "rptlUserInfo"
    DoCmd.OpenReport stDocName, acPreview

Exit_Command15_Click:
    Exit Sub

Err_Command15_Click:
    MsgBox Err.Description
    Resume Exit_Command15_Click
    
End Sub
 
Last edited:
Just a guess but I'm thinking you need to set up the report with a sub report that mimicks the form/subfrom set you have - ???
 
that should not matter if I am doing a queurry and only passing the id of the form
 
Instead of putting the id in the filter can you try puttng the id in the query as a parameter?
 
Instead of putting the id in the filter can you try puttng the id in the query as a parameter?

how do I do that?
 
Last edited:
In the id column just put the following in the criteria line:

Forms![formUsers]![id]

???
 

Users who are viewing this thread

Back
Top Bottom