Using Access 2007<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
I am trying to build a form out that has a number of text fields lookup values from a reference table based on a drop down. <o></o>
<o></o>
I thought utilizing the DLookup function would be the way to go, but I just can’t for the life of me understand how to write the syntax properly. <o></o>
<o></o>
I have a form called Executed Project Details<o></o>
The form references a table called Executed Projects<o></o>
I have a drop down that looks at a table called Project Types.<o></o>
The project types are as follows:<o></o>
<o></o>
So based on that designator, I want to lookup the values in another table called ProjectCurves
<o></o>
ProjectCurves has the following structure<o></o>
<o></o>
So my thought was to put in a Dlookup for each of the 3 boxes I want to populate based on an AfterUpdate event from the dropdown menu. <o></o>
<o></o>
That gives me something like this<o></o>
<o> </o>
However upon the after update event, I get a Run-time error 2471:<o></o>
The expression you entered as a query parameter produced this error: ‘Project_Discipline’<o></o>
<o> </o>
I am now stumped…<o></o>
<o></o>
I am trying to build a form out that has a number of text fields lookup values from a reference table based on a drop down. <o></o>
<o></o>
I thought utilizing the DLookup function would be the way to go, but I just can’t for the life of me understand how to write the syntax properly. <o></o>
<o></o>
I have a form called Executed Project Details<o></o>
The form references a table called Executed Projects<o></o>
I have a drop down that looks at a table called Project Types.<o></o>
The project types are as follows:<o></o>
ID--Project Type<o></o>
1 Combined Cycle 1x1<o></o>
17 Combined Cycle 2x1 <o></o>
33 Biomass<o></o>
49 AQCS<o></o>
65 Circulating Fluidized Bed<o></o>
Based on the selection it stores the ID number in a field called ProjectTypeDesignator<o></o>1 Combined Cycle 1x1<o></o>
17 Combined Cycle 2x1 <o></o>
33 Biomass<o></o>
49 AQCS<o></o>
65 Circulating Fluidized Bed<o></o>
<o></o>
So based on that designator, I want to lookup the values in another table called ProjectCurves
<o></o>
ProjectCurves has the following structure<o></o>
ID---Project Discipline----Month 1-----Month 2<o></o>
Now that I have selected the project type and know the designator I want to pull Project Discipline, Month 1 and Month 2 into three new texts boxes called Discipline 1, Civil 1 and Civil 2.<o></o>
<o></o>
So my thought was to put in a Dlookup for each of the 3 boxes I want to populate based on an AfterUpdate event from the dropdown menu. <o></o>
<o></o>
That gives me something like this<o></o>
Code:
[COLOR=black][FONT=Verdana]Private Sub Combo176_AfterUpdate()
Me.Discipline_1 = DLookup("Project_Discipline", "ProjectCurves", Me.ProjectTypeDesignator)
Me.Civil_1 = DLookup([Month 1], "ProjectCurves", Me.ProjectTypeDesignator)
Me.Civil_2 = DLookup([Month 2], "ProjectCurves", Me.ProjectTypeDesignator)
End Sub<o:p></o:p>[/FONT][/COLOR]
However upon the after update event, I get a Run-time error 2471:<o></o>
The expression you entered as a query parameter produced this error: ‘Project_Discipline’<o></o>
<o> </o>
I am now stumped…<o></o>