Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TWO ISSUES

Status
Not open for further replies.

tps131

MIS
Sep 5, 2002
27
US
Problem I am having is I have a form where you add new projects, containing a project name and autonumber projectID, The project is the highest level in the database, next I have a screen that comes up where you add the requirements for that project into a table..Very simple idea but having some serious problems...First I want to be able to display the project name on the top of the form where you enter the requirements..what i did was used the expression builder takikng the value from the previous form to display the project name =[Forms]![frmEditReq]![cmbProject]...that only displays the projectID, not the name...Next issue is I want to be able to carry the projectID number in the form and after adding the requirements save the appropriate ProjectID number to correspond with the ProjectName, instead of having to type it in everytime..Suggestions
 
To solve your first problem, try changing:
Code:
=[Forms]![frmEditReq]![cmbProject]
to this...
Code:
=[Forms]![frmEditReq]![cmbProject].Column(1)
This should work as your combo box probably has two columns, one for the ID and one for the text name, but the width of the ID column is probably 0cm, so you don't see it. Specifying the Column with Index 1 should specify the project name column (it's a zero-based index).

For the second problem search Access VBA help for OpenArgs - this is a parameter in the DoCmd.OpenForm statement that lets you pass arguments to the newly opened form - sounds ideal for taking information in from your other form. Or you could just reference it directly ([Forms]![frmEditReq]![cmbProject]) if the other form is staying open.

Hope this helps.

[pc2]
 
First one worked...it is displayed but it wont save it to the table where the other data is being saved since it is referenced to the other form not the table
 
Well you have to write some other code to do the save. Maybe a command button that executes a SQL query?
 
Consider having a main form with subforms instead of pop forms. This save the information realted to each JobID and all of the job details in seperate tables but see them all in one form. Link the child and master subforms to the Mainform with the JobID, that way each time you change JobID's in the main form the correct parts follow in the subforms. Also I used continuous forms with combo boxes for my subforms. Table relationships are also important to make this work properly.
HTH
 
I got it to work...issue was I had the default value and control source all messed up...Thank you for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top