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 seems like it should be so easy...

I've got a form, 1Loan, with an LoanID field. I want to use a command button on 1Loan to open a form, sysApps, that will only display the multiple records from a different table that have the same Loan ID.

This code gives me an error on the "sysApps!loanid=lid" line: Object required. Without that line, i get nothing.

What am I doing wrong?

Code:
    Dim stDocName As String
    Dim stLinkCriteria As String
Dim lid As Double

lid = Me!LoanID
    stDocName = "sysApps"
    
    stLinkCriteria = "[LoanID]=" & lid
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    sysapps!LoanID = lid
 
okay, that makes nice new records with the proper LoanID with no error but doesn't show me the existing records with that loan id.
 
Solun,

Have tried:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "sysApps"

stLinkCriteria = "[lid]=" & Me![LoanID]
DoCmd.OpenForm stDocName, , , stLinkCriteria


**Make sure your form "sysApps" is set to Continuous Forms
 
Yes, that's the default cmd button wizard results, and yes, i've got the form set to continuous (checked, double checked.)

 
Solun,

Works fine in my example.
Whats the relationship of LoanID to lid. I am assuming you have a 1:Many, LoadID being the 1 and lid being the many.

LoanID being in the table behind your 1Loan form and
lid being in the table behind your sysApps continous form.
 
is your pop-up form's Data Entry property set to YES? If so, it should be set to NO.


Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top