WineSnob
Not Bright but TENACIOUS
- Local time
- Today, 00:17
- Joined
- Aug 9, 2010
- Messages
- 211
I have this code
It works fine. However I need to replace "[40]" with x and replace 70 with y.
I can't get the syntax right.
I have tried
Me.rdt = DLookup([x], "TblJoint", "[OldestAge]=[y]") and tried
Me.rdt = DLookup(x, "TblJoint", "[OldestAge] = y")
Thanks in advance
Code:
Private Sub Command12_Click()
Dim x As Integer
Dim y As Integer
x = Me.spouseage
y = Me.clientage
Me.rdt = DLookup("[40]", "TblJoint", "[OldestAge]=70")
End Sub
I can't get the syntax right.
I have tried
Me.rdt = DLookup([x], "TblJoint", "[OldestAge]=[y]") and tried
Me.rdt = DLookup(x, "TblJoint", "[OldestAge] = y")
Thanks in advance