DLookup error

  • Thread starter Thread starter Charlie O'Neill
  • Start date Start date
C

Charlie O'Neill

I am using Access 2007 on a Windows 7 Professional platform. I am using a
command button on click with an event procedure The following code produces
an error while debugging. The error states “Argument Not Optional†and
highlights the DLookup in the varX.


Private Sub Tax_ID_Click()

Dim varX As Variant
Dim homePath As String

varX = DLookup("[LC_Tax_ID2],q_Homes w Tax,
[HomeID]=[forms]![Members]![HomeID]")

homePath = "http://www.lakecopropappr.com/property-details.aspx?AltKey=" &
varX

Application.FollowHyperlink homePath

End Sub

Thanks Charlie
 
Your quotes are wrong.

varX = DLookup("[LC_Tax_ID2]","q_Homes w
Tax","[HomeID]=[forms]![Members]![HomeID]")

although you might have to use

varX = DLookup("[LC_Tax_ID2]","q_Homes w Tax","[HomeID]='" &
[forms]![Members]![HomeID] & "'")

(I'm assuming HomeID is a text field above.)
 
Back
Top