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

Why Object required when linking to another form? 1

Status
Not open for further replies.

splats

Technical User
Jan 2, 2003
131
Hello

Here is my code, I want it to link to the form and fill in automatically for the ApplID if it does not exist already in the second form - frmApplicantCostsCombo
Any suggestions would be greatly appreciated.

Thank you!

Private Sub cmdAppCosts_Click()
On Error GoTo Err_cmdAppCosts_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmApplicantCostsCombo"

stLinkCriteria = "[ApplID]=" & Me![ID]

DoCmd.OpenForm stDocName, , , stLinkCriteria
frmApplicantCostsCombo![ApplID] = " & Me![ID]"

Exit_cmdAppCosts_Click:
Exit Sub

Err_cmdAppCosts_Click:
MsgBox Err.Description
Resume Exit_cmdAppCosts_Click

End Sub
 
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoEvents
Forms!frmApplicantCostsCombo![ApplID] = Me![ID]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thank you PHV!

It works great~

tinat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top