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

Pass value from form to popup form 1

Status
Not open for further replies.

solun

Programmer
Apr 1, 1999
55
(This may be a structural problem... I'm open to ideas.)

I have five different kinds of forms for five different kinds of loan activities. All five use a common application form that I've put in a separate form accessed by a cmd button. I want to pass the loanID from the specific activity form to the general application form. It seems to me that I ought to be able to do this in the onclick event procedure with something like:

Forms![2 CollateralMortgage]!LoanID = Forms!sysApps!LoanID

but i'm not (yet) a VB coder.

Thanks!
Heidi



Heidi I. Jones
Ridgerunner Consulting
Questions Answered. Problems Solved.
 
You right in how to set the value. So I'm not sure what problem you're having.
 
okay, i resolved that little problem - i had the source & destination backwards.

But it still doesn't set the value. I do have the field "loanid" twice on the form - once in the header, once in the body.

Heidi I. Jones
Ridgerunner Consulting
Questions Answered. Problems Solved.
 
You might have loanid twice on the form, but each control has a different name. If you want both of them changed, then your code would look like this:

Forms!frmDestination!loanid_1 = loanid
Forms!frmDestination!loanid_2 = loanid


Where loanid is the name of the control on the source form, and the 2 controls on the destination form are named loanid_1 and loanid_2
 
That was very helpful, but still didn't work. I can open the app(destination) form and it pulls the correct existing apps, but when i try to enter a new app, it doesn't keep the loanid.



Heidi I. Jones
Ridgerunner Consulting
Questions Answered. Problems Solved.
 
I'm not sure what you mean. I'm assuming you now have 2 forms open and you are attempting to open a 3rd form. And you want the loanid of the 3rd form to reflect the loanid of the other 2 forms. Is this correct? If so, is the loanid a field within a table? If so, then all you need to do is to save the record and requery your forms.
 
I'm sorry I'm not being clear...

Form1 is the source, apps is the destination. Only two forms open.

LoanID is in each query.

I'm going to try the save & requery that you suggest. I'm not sure why this is being difficult for me.

Thanks again!

Heidi I. Jones
Ridgerunner Consulting
Questions Answered. Problems Solved.
 
I think another point i didn't make clear: The app (destination) form is using continuous forms to show all the current apps and allow entry of a new app. The new app is where i'm getting the problem of it losing the original loanID. it worked fine when i used just the simple cmd button wizard to associate sourceform1 and apps(destination) but now that i have sourceforms1-5, of course the wizard doesn't like that because it wants static references to the sourceformN name. That's why i've been trying to get the sourceformN to have a slightly different cmdbutton. Is there something else I should be doing??



Heidi I. Jones
Ridgerunner Consulting
Questions Answered. Problems Solved.
 
Ok, you're adding a new app but the loanid is not displaying the current loanid. Why not just set the default value of the loanid control to the value of loanid. That way, if a new record is added, the loanid will automatically be set. Or am I still not following you? If not, give me some examples.
 
Dear Fancy -

Thanks for your help. I've tried all your suggestions and I think that it's the classic Id-10-t error. I'm going to re-write it and try to get it cleaned up. Again, thanks.

Best,

Heidi

Heidi I. Jones
Ridgerunner Consulting
Questions Answered. Problems Solved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top