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

Dlookup on Subform does not work

Status
Not open for further replies.

njitter

Technical User
Sep 4, 2001
122
US
Hi,

i have a mainform with a subform.

I have set a Dlookup on a Combobox to fill a textbox. The Dlook works when i just run the SubForm, but when i run this Subform in the Mainform i get the following error:

Code:
Run-time error '64479':

The expression you entered as a query parameter produced this error: 'The object
doesn't contain the Automation object 'Forms!frmJobs!Job.''

The Subform contains the following code:

Code:
Private Sub Combo18_Change()
Dim varOmschrijving
  varOmschrijving = DLookup("[Onderwerp]", "Table Onderwerp", "[Job] = Forms![frmJobs]![Job]")
  If (Not IsNull(varOmschrijving)) Then Me![Omschrijving] = varOmschrijving
End Sub

frmJobs is the name of the Subform.

How do i get this Subform to work in the MainForm ?

Thanks for any input,

Martijn


---
There are no stupid Questions -- just stupid People
 
Martin,

I believe the subform is considered a control on the main form.

Try
Code:
...[Job] = Forms!MainFormName![frmJobs]![Job]")...


HTH

John

Use what you have,
Learn what you can,
Create what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top