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

DLookup Returns Error Message ??

Status
Not open for further replies.

jkirkland

Technical User
Apr 24, 2003
61
US
The following code is returning an error message that says that an object was expected but I'm relatively new to VBA and I don't know what that means.

Can anyone help me with the syntax?

Thanks!

Private Sub Report_Open(Cancel As Integer)
If (DLookup("[GMELM1]", "HTEDTA_GM230AP", "[GMELM1]<>4 AND [GMDPT]=0 AND [GMDIV]=0 AND [GMFUND]=REPORTS![R-FUND-ALL-SUM]![GMFUND]") Is Null) Then
Me.MSG_NO_REV.Visible = True
Me.R_FUND_ALL_REV_SUM_SUBRPT.Visible = False
End If
 
I made a modification to the expression for the DLookup.

Code:
Private Sub Report_Open(Cancel As Integer)
If (DLookup("[GMELM1]", "HTEDTA_GM230AP", "[GMELM1]<>4 AND [GMDPT]=0 AND [GMDIV]=0 AND [GMFUND]= " & REPORTS![R-FUND-ALL-SUM]![GMFUND]) Is Null) Then
Me.MSG_NO_REV.Visible = True
Me.R_FUND_ALL_REV_SUM_SUBRPT.Visible = False
End If
End Sub

Post back if you have any questions.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top