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

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
 
Isn't this more a forms question (forum702?)

Anyway, if you want to push the value, try referencing through the forms collection

[tt]forms!sysapps!LoanID = lid[/tt]

Else try passing the value through openargs - some approaches should be available through search

Roy-Vidar
 
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.

i realized after I posted this that it was a forms question not a vba question, so i reposted there. i'm sorry. thanks for answering anyway.
 
Check the DataEntry property of the form "sysApps".

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

Part and Inventory Search

Sponsor

Back
Top