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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting value from textbox into another form's textbox

Status
Not open for further replies.

accessguy52

Programmer
Sep 18, 2002
73
0
0
US
Hi! This is driving me crazy. I want to get 2 values from Form1 into the tables that populate Form2. I do this by an Update query, BUT, I keep getting a Parameter input box for my values from Form1. My query will NOT let me put the "Like Form1!text1.text" - does not accept "Like". I tried it an Append (Insert) query and THEN the Update query but then I get the paramenter inputs TWICE!!

Can anyone help me on this??? Many thanks!

accessguy52
 
Can you show us the Update statement?

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Cajun - here it is, nothing special.

UPDATE tblRisk_Severity_Levels SET tblRisk_Severity_Levels.Project_Name = [frmProject2].[Title], tblRisk_Severity_Levels.Project_Number = [frmProject2].[FP_ID];

This executes when I close the form and go to the Severity levels form. What I'm trying to do is carry over the Project Name and ID to the new form. Does the original form with the Project Name/ID still have to be open? I've tried it like that and it still asks for the parameters. If I put the right Name and ID in the query WILL work. I just don't want my users to have to enter in those parameters each time. To sum up, I want the values from the text boxes (in Project Form) to be updated in to the Severity Form. Thanks for any suggestions.

accessguy52
 
frmProject2 has to be open when you execute the update statement, and Title and FP_ID have to be valid controls on that form.

I think I would try the following:

UPDATE tblRisk_Severity_Levels SET tblRisk_Severity_Levels.Project_Name = [Forms]![frmProject2]![Title], tblRisk_Severity_Levels.Project_Number = [Forms}![frmProject2]![FP_ID];


Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Cajun - I tried that, in code, not a query, and I got an error message saying "Too few Parameters. Expected 2". So, Access has NO idea what's in the text controls. Baffling. I've seen this work before in other situations, I can't understand it.

accessguy52
 
I would double check all my spelling.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
I tried that, in code, not a query
Something like this (within frmProject2)?
DoCmd.RunSQL "UPDATE tblRisk_Severity_Levels SET Project_Name='" & Me.Title & "',Project_Number=" & Me.FP_ID
Provided that both Project_Number and FP_ID are numeric.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top