Command button to open a subform

nnabbale

Registered User.
Local time
Today, 00:30
Joined
Feb 16, 2012
Messages
12
Hi all

I would really appreciate you help.

i created a subform by dragging a form over another, it all works OK as it gives me details about the item Im dealing with in one screen in 2 forms (the main - 'Progress/Status' and subform - 'Saving')

However there is so much detail on the screen and I would like to create a command button on the main form that opens a subform with information only for the current record. I tried to create the command button, but it opens thesubform in form view with all the other records in that form which i dont want to see.

Can you please advice me on how i restrict it give information about the current record and not all records present in the form?

I have attached to db for reference

thanks
 

Attachments

Thanks Paul, i have created a control and used the Action Arguments control and entered the following
Form Name: Saving
View: Form
Filter Name: [Forms]![Saving]![ProjectID]
Data Mode: Add
Window Mode: Normal

that macro runs and takes me to the form but opens a new record each time and does show the data that already exits for that record

What AmI missing.

Also i dont know where to enter the DoCmd sql, apologies Im new to this, how do i use that?

thanks a mil
 
Paul

I have followed your instructions and entered the following

Private Sub Command48_Click()
DoCmd.OpenForm "Saving", , , ProjectID = " & Me.ControlName"
End Sub

But it still opens a new record - apologies for being a wooz
 
You didn't get the syntax quite right. Try:

DoCmd.OpenForm "Saving", , , "ProjectID = " & Me.ControlName

You also need to replace "ControlName" with the name of the control (textbox, combo, etc) that has the ProjectID value in it.
 
Hi Paul

Really appreciate your time but it still hasnt worked, still opens a new record

Really frustrating!!! urrggghhhh

thanks anyway
 
What is your code now?
 
DoCmd.OpenForm "Saving", , , "ProjectID = " & Me.ProjectID
 
I have projectID in the main form (progress/Status) which is linked to the Subform (Saving). If you look at the form on my database called Progress/Status, the savings Subform automatically loads the ProjectID from the main form and keeps the entries for that ID, i would like to open the subform in another window via a command button but have it function the same way as it is in the main form
 
Your field name has an inadvisable space in it. This works:

DoCmd.OpenForm "Saving", , , "[Project ID] = " & Me.[Project ID]
 
Thank you SOOO Much Paul, that almost brought me to tears, been at it for hours.

I have another question about reports can you help - I hate to impose

MUCH appreciate
N
 
Happy to help, and welcome to the site by the way!

A new question should be started in a new thread. It keeps the forum better organized and helps people searching for answers later. I'll keep an eye out for it.
 

Users who are viewing this thread

Back
Top Bottom