Subforms- Pages- Linking

Hi, 
I will try and explain this as clearly as possible... I have a main 
form with five tabs, one of the tabs has a subform, on the subform I 
have a column called "Status".  This subform contains details from the 
Project Table, with the unique Project_ID.  I also have a separate 
table Project Status which relates to the Project Table by the 
Project_ID.  What I would like to have happen is that when you click 
on "Status" another form pops up with data from the Project Status 
table using the Project_ID from the subform that you just clicked on. 
The problem I have is that everytime I click on the "status" link, 
Access says that it can't find the subform that it's looking for.  I 
don't know the correct naming for the code.  This is the code as I 
have it now: 
Private Sub Status_Click() 
On Error GoTo Err_Status_Click 

    DoCmd.RunCommand acCmdWindowHide 
    DoCmd.OpenForm "Project Status" 


    Forms![Main Form].[Project_Estimates_Subform].Form!Project_ID = 
Forms![Project Status lfb]!Project_ID 


Exit_Status_Click: 
    Exit Sub 


Err_Status_Click: 
    MsgBox Err.Description 
    Resume Exit_Status_Click 
End Sub 


Any help would be GREATLY appreciated.  I've been trying to figure 
this out and haven't a clue. 
Thanks, 
krista 



0
Utf
8/7/2007 3:06:04 PM
access 16762 articles. 3 followers. Follow

2 Replies
588 Views

Similar Articles

[PageSpeed] 45

krista:

As, if I understand you correctly, the code is being executed in the 
subform's module you don't need to worry about referencing it fully, you can 
simply use Me, or even omit it altogether.  Secondly you need to filter the 
Project Status form; at present you seem to be trying to assign a value to 
the subform's Project_ID, which doesn't make a lot of sense to me.  The 
relevant code to open the Project Status form filtered would be like this:

Dim strCriteria As String

strCriteria = "Project_ID = " & Me.Project_ID

DoCmd.OpenForm "Project Status", _
    WhereCondition:=strCriteria, _
    WindowMode:=acDialog

As well as filtering the form to the current Project_ID  the above code 
opens it in dialogue mode, which forces the user to close (or at least hide) 
it before returning to the original form.

Ken Sheridan
Stafford, England

"Krista" wrote:

> Hi, 
> I will try and explain this as clearly as possible... I have a main 
> form with five tabs, one of the tabs has a subform, on the subform I 
> have a column called "Status".  This subform contains details from the 
> Project Table, with the unique Project_ID.  I also have a separate 
> table Project Status which relates to the Project Table by the 
> Project_ID.  What I would like to have happen is that when you click 
> on "Status" another form pops up with data from the Project Status 
> table using the Project_ID from the subform that you just clicked on. 
> The problem I have is that everytime I click on the "status" link, 
> Access says that it can't find the subform that it's looking for.  I 
> don't know the correct naming for the code.  This is the code as I 
> have it now: 
> Private Sub Status_Click() 
> On Error GoTo Err_Status_Click 
> 
>     DoCmd.RunCommand acCmdWindowHide 
>     DoCmd.OpenForm "Project Status" 
> 
> 
>     Forms![Main Form].[Project_Estimates_Subform].Form!Project_ID = 
> Forms![Project Status lfb]!Project_ID 
> 
> 
> Exit_Status_Click: 
>     Exit Sub 
> 
> 
> Err_Status_Click: 
>     MsgBox Err.Description 
>     Resume Exit_Status_Click 
> End Sub 
> 
> 
> Any help would be GREATLY appreciated.  I've been trying to figure 
> this out and haven't a clue. 
> Thanks, 
> krista 
> 
> 
> 

0
Utf
8/7/2007 6:02:00 PM
Hi Ken,
Thank you so much!  It turns out that it was a combination of an incorrect 
code as well as a bad criteria on a list box in the Project Status form.  I 
really appreciate you getting back to me so quickly.

krista

"Ken Sheridan" wrote:

> krista:
> 
> As, if I understand you correctly, the code is being executed in the 
> subform's module you don't need to worry about referencing it fully, you can 
> simply use Me, or even omit it altogether.  Secondly you need to filter the 
> Project Status form; at present you seem to be trying to assign a value to 
> the subform's Project_ID, which doesn't make a lot of sense to me.  The 
> relevant code to open the Project Status form filtered would be like this:
> 
> Dim strCriteria As String
> 
> strCriteria = "Project_ID = " & Me.Project_ID
> 
> DoCmd.OpenForm "Project Status", _
>     WhereCondition:=strCriteria, _
>     WindowMode:=acDialog
> 
> As well as filtering the form to the current Project_ID  the above code 
> opens it in dialogue mode, which forces the user to close (or at least hide) 
> it before returning to the original form.
> 
> Ken Sheridan
> Stafford, England
> 
> "Krista" wrote:
> 
> > Hi, 
> > I will try and explain this as clearly as possible... I have a main 
> > form with five tabs, one of the tabs has a subform, on the subform I 
> > have a column called "Status".  This subform contains details from the 
> > Project Table, with the unique Project_ID.  I also have a separate 
> > table Project Status which relates to the Project Table by the 
> > Project_ID.  What I would like to have happen is that when you click 
> > on "Status" another form pops up with data from the Project Status 
> > table using the Project_ID from the subform that you just clicked on. 
> > The problem I have is that everytime I click on the "status" link, 
> > Access says that it can't find the subform that it's looking for.  I 
> > don't know the correct naming for the code.  This is the code as I 
> > have it now: 
> > Private Sub Status_Click() 
> > On Error GoTo Err_Status_Click 
> > 
> >     DoCmd.RunCommand acCmdWindowHide 
> >     DoCmd.OpenForm "Project Status" 
> > 
> > 
> >     Forms![Main Form].[Project_Estimates_Subform].Form!Project_ID = 
> > Forms![Project Status lfb]!Project_ID 
> > 
> > 
> > Exit_Status_Click: 
> >     Exit Sub 
> > 
> > 
> > Err_Status_Click: 
> >     MsgBox Err.Description 
> >     Resume Exit_Status_Click 
> > End Sub 
> > 
> > 
> > Any help would be GREATLY appreciated.  I've been trying to figure 
> > this out and haven't a clue. 
> > Thanks, 
> > krista 
> > 
> > 
> > 
> 
0
Utf
8/7/2007 6:52:03 PM
Reply:

Similar Artilces:

Linking drawing pics from internet
If somebody can help me with this problem please, I'm trying to link t my worksheet/catalog some drawings, in my worksheet I have th manufacturer number of this drawings, so this could help when I writ the number in the cell I want to call this drawing fro internet/drawings catalog, if somebody know how to do it please let m know. Thanks in advance guys -- Message posted from http://www.ExcelForum.com Try this Sub Add_Picture_from_Website() ActiveSheet.Shapes.AddPicture "http://www.rondebruin.nl/images/" _ & Range("A1").Value & ".jpg", msoTrue, _ ...

subform in subform
Hi, I've got a form F and subform S1 in it. And inside S1 I've got subform S2. How do I reference a text box in S2 from VB code? thanx alek_mil Try: forms!F!S1!S2!textbox That should do the trick -- Maurice Ausum "alekm" wrote: > Hi, > I've got a form F and subform S1 in it. And inside S1 I've got subform S2. > How do I reference a text box in S2 from VB code? > thanx > > alek_mil You might find this useful as well... http://mvps.org/access/forms/frm0031.htm -- Jack Leach www.tristatemachine.com &q...

How To Stop Acces From Update The Record When The Subform Query Is On Focus?
Hi I need to know how to stop acces from update the record when the subform query is on focus? Thanks In news:1177155216.699820.268130@d57g2000hsg.googlegroups.com, Chipcom <bz1977@gmail.com> wrote: > > I need to know how to stop acces from update the record when the > subform query is on focus? If you mean that you want to keep the main form's record from being saved when the subform gets the focus, the only ways you can do that are: 1. Have the main form be unbound. In that case your own code has to do the job of reading the record, assigning its field values to ...

How to roll down a new page
I have a welcome page that show for a instant and then is replaced with the home page. It would be nice if the Home page unrolled on top of the welcome page or slid in from the side like a slide might or the wecome page looked like a page turning. I have no idea how such things are accomplished. Can you give me a place to read up or a sugestion as to what to google? Thank Check out ASP .NET AJAX or Silverlight Develpment. -Scott " Cal Who" <CalWhoQQ@roadrunner.com> wrote in message news:umDEnSHdKHA.6096@TK2MSFTNGP02.phx.gbl... >I have a we...

Links error when insert line/row to source workbook
I have a question regarding links on Microsoft Excel 2003. If I insert a line into the source spreadsheet, the link on the destination spreadsheet doesn't work anymore because the cells moved. The scenario: On the destination spreadsheet, the link is =[ACME.xls]Sheet1'!A1 But if I insert a line on ACME.xls, making the info in cell A1 move down to A2, the link on the destination spreadsheet still pulls from cell A1. How do I ensure that when I insert/delete lines/row, the link still pulls info from the correct cell? Thanks Stella If you have the workbook with the fo...

Textbox Information to Subform
I have a subform that I need to contain information from a main form. The sub form is linked by studentID, but I also need the tardy ID, TardyID, to populate the subDhall field txtTardyID. I tried the AfterUpdate of TardyID with this: Me!subDhall.txtTardyID=Me!frmTardyAdd.TardyID and Me!subDhall.frmTardyAdd.txtTardyID=Me!frmTardyAdd.TardyID to no avail. Anyone have any tips? -- Thanks As Always Rip "Ripper" <Ripper@discussions.microsoft.com> wrote in message news:753FE132-F478-4952-ABEE-EA884BB75A19@microsoft.com... >I have a subform that I need to contain informat...

Page jumping
I seem to have a glitch on my new worksheet when I select a drop dowbn cell, or click a check box, or just press enter my sheet jumps to cells higher up, sometimes foating imagionary cells over the top of true ones, Only doing it on this speadsheet, though not old ones ...

Clicking on links in mail hangs up Outlook
I hope someone can help me with this problem. I am using Outlook 2000, IE6, Win XP with SP2. I have experienced this problem in the past, but it has either rectified itself, or because of something I have done, which I don't have a clue as to what it is! In the past, when I click on a link, it does not open the browser. It just hangs up the email and I must use Cntl+Alt+Del to close the mail system and try again. Currently, oddly enough, it will work normally with some links, but not with others. I suspect this is some security setting, but for the life of me I cannot figure it...

Formulas do not link to other workbooks
Usually when linking to another workbook, you start typing the formula, click in the other workbook, and it adds the file name & cell reference into the formula. However, I have a PC at work which has started to behave differently. When you start to type a formula, and then click into another workbook, the editing disappears as if you had simply switched to a different workbook. When you go back to the original workbook, the cursor is still in the formula bar, but no reference to the other workbook. Does anyone have a clue what is going on, and how to cure it? Thanks! Just a guess... ...

Subform of a subform?
Is there a way to create a two subforms (sub1 and sub2) on one main form, but have the second subform (sub2) actually be a subform of the first (sub1)? ...

Utility to change location of linked tables?
Is there a utility available which will quickly and easily modify the location of linked tables? In other words, the problem I want to solve is to use the same application on different sets of data on the same computer. I don't want to move the tables around. I want to look at the same tables names but in different folders on my computer, depending on what the user chooses. e.g., You can choose Class 1 or Class 2 or Class 3, and the application would look at c:\Class1\Students.mdb or c:\Class2\Students.mdb or c:\class3\Students.mdb SORRY! Accidentally posted to the wrong n...

Subform with Macro
I have a form (frm_BinDetails), within this form I have a subform (frm_Cable). frm_Cable has a listbox (List23) which when the user clicks on an entry the contents of the first column of that listbox are displayed in a textbox (txt_ProcessID). The on click event of the listbox runs a macro with the following code Action = SetValue Item = [Forms]![frm_Cable]![txt_ProcessID] Expression = [Forms]![frm_Cable]![List23] When I run the form frm_Cable on its own the macro works correctly but when I try and run from frm_BinDetails then whenever I click on an entry an error message appears saying th...

opening a subform to a specific record?
Hey y'all, I've got a form that lists all the Students in a class and a link to "Edit Student Information" which opens a form to edit individual records. The link uses the same type of code generated by the form wizard and it automatically filters the records to the class. The next thing I want to do is to open the new form to exactly the record that was highlighted in the list. I can capture the list position from the subform (SelTop) and I found a method called "GoToRecord" that works like this to go to the 8th record: DoCmd.GoToRecord acDataForm, "Studen...

Get Subform Data
I'm looking for a way to get the data from a chosen record in a continuous subform. I have a customer form and a continuous subform with all of the charges associated with the customer. Is it possible to have a button on the form, prompt the user to highlight a record (the charge info.) in the continuous subform and get the information about the charge? If there is not a way to do this, I'm pretty sure that I can achieve what I want to do via a list box. Open the subform in design view, and set its Record Selectors property to Yes. (This is a property of the Form, not o...

Bills Summary Page crash
When on the Bills Summary page in MS Money 2006 Premium and I Attempt to sort the list of bills by the payee column, Money quits without an error message. In microsoft.public.money, Brewster wrote: >When on the Bills Summary page in MS Money 2006 Premium and I Attempt to sort >the list of bills by the payee column, Money quits without an error message. http://support.microsoft.com/kb/900969/en-us symptoms are not the same, but perhaps similar enough. My problem does not appear to be the same as the one described in kb 900969. The KB article 900969 descibes a problem when clicking ...

How can I split a line from Text file in two link lists
Hi I am doing and assignment and got into a problem if any one can help me: I am reading Manager's information from a text file which had a list of Reporting supervisors as its list element. I am suppose to use link lists created by me nothing built in. I created two lists one can read rest all of information but when it comes to last for second Link list nodes, I simply can't get it. I am using "fin" for reading file. program works for one list. Reporting supervisor list has varying number of elements. I am confused in how to join both and how can I read half line in first ...

Subtotal on every page
Hello NG. I'am using SSRS 2005 for printing quotes. Now I need a function to place a subtotal on every bottom of a page. Does anyone had an idea?? Thanks You can create a text box in a page footer and then refer back to the subtotal box in the report. You refer back to the subtotal by putting this in the expression on your page footer. ReportItems!Subtotal.Value Just replace the word Subtotal with your exact field name in the report. It is case sensitive! "Ulf Unger" <uunger@planit-cologne.de> wrote in message news:ukLxA$rkKHA.6096@TK2MSFTNGP...

Why is my publisher file printing in the center of the page?
I am trying to print some tickets for a give away. I got "Blanks/USA" Regular tickets and I can not get this to print correctly. I have corrected the margins, and corrected the "custom" page size to 8.5 x 6.5. When I print either in landscape or portrait it prints like it is printing on 8.5 x 11 in the center of the page with cut marks, assuming it will be cut down by a printer! I want to print it on 8.5 x 6.5. I am sure this is something simple I am overlooking and would be grateful for helpful advise. thanks You need to select File Printer Setup Then select...

Printing a single record from a tab control subform
Hi I have created a Case Management Database of students. It consists of a main form and a subform. The main form consists of information that must be seen at all times. since it consists of information about each student. The subform consists of a tab control. There is a different subject on each page of the tab contol, e.g. General Information, Current Student Information, etc. I need to print out the mainform and subforms so I created reports for each subform in my tab control. I want to put a "Print" button on each page of my tabcontrol so that when cl...

Adding links to the manager taskpad
Hi, Trying to find out if it is possible to add custom links to either the store or HQ manager taskpad, and if so how. The HTML pages can quite easily be edited to add a href but then how to actually fire off an add-on? For example the 'Items' screen in the Store manager taskpad has the HTML line <a href="createnewitem">New Item</a> how is "createnewitem" used to fire off the Create New Item screen? thanks dave I would also love to know how the taskpad works in this respect. I was thinking of running the RMS Manager as a ...

Referencing Page Names in a Custom Properties Dialog Box
Hi, I created a report based on the elements of a page in a Visio document. However, I would like to be able to run this report in an empty page of the same document and reference the page name that this report should be based on. The reason for this being that some pages might be too long to fit a report as well as the contents. Also, I would like to avoid using any other application like Excel for exporting information. The way I tried to do this was by customizing the properties of the report object so that on drop it will ask what page to make reference to. My idea was to provide the nam...

Code to duplicate data from one subform to two other subforms
This is my first database so I hope I am able to talk the language well enough to get help. I have a form with three subforms. The 1st subform is titled Service Record subform and has fields for Department, Job Title, Date In, Date Out, and Time Served. The 2nd and 3rd subforms are Department Service and Job Title Service. I would like to be able to enter an employee's information in the 1st subform and have it populate the 2nd and 3rd subforms. I am wanting the Department Name along with time served to populate the 2nd subform and the Job Title Name and time served populate th...

Task on Today Page
I am using Outlook 2003 with Windows XP. I had a task that shows up on the Today page but not in any other listing under the Tasks folder. The task also has a subject that is simply a dash on the Today page. When I click on the subject, it does nothing. When I try to mark it complete, it does nothing. After much frustration and troubleshooting, I found that the task was actually assigned to me from SharePoint. The task appeared with the original subject in the task list, which is why I couldn't find it. I was looking for a dash as the subject. I deleted the task in the Tasks list a...

Linking subforms on a tabbed page
Hello, I have a database that uses a main form with several tabbed pages. On one tabbed page I have two subforms. The first subform lists all the records in datasheet view. When the user selects a record in the first form it should display the details for that specific record in the second subform. I have created a hidden text field (txtRelay) that references the id field for the selected record in the first subform ([fsubSec_Data].[Form]![txtSecurityID]) and placed it on the tabbed page. I then have tried to link the records on the second form using the Master and Child fields....

How do I print just the odd or even numbered pages.
I have a printer that will not duplex, and so I am trying to print the odd number pages and then turn over the paper and print the even numbered pages. Can anyone tell me how to accomplish this. I thought it would be an easy thing, but am having no luck? ThankS! It really depends on your print driver more than excel. A paper wasting method though is to print it all turn the pages over and print from page 2. you have to throw out half the pages. "Mrs. Ike" wrote: > I have a printer that will not duplex, and so I am trying to print the odd > number pages and then turn o...