L
larochy
Hi,
I'm trying to do a Dlookup with multiple items in the [Criteria] section and
it's not working. Here is the code:
Private Sub Role_AfterUpdate()
If Me.SKU = "UNCR-3" Then
[Rate] = DLookup("[Rate]", "[tblProjectRates]", "[Role]=
[tblProjectRates]![RoleName]" And "[ProjectID] =
[tblProjectRates]![ProjectID]")
Else
Me.Rate = [Text51]
End If
End Sub
I store rates in a table called [tblProjectRates] and the rate is tied to a
RoleName and the specific ProjectID. When the user updates the [role]
ComboBox in the form, I want it to automatically populate the [Rate] field
with the appropriate rate based on the ProjectID and the Role stored in the
Project Rates table.
Any code corrections would be much appreciated.
Thanks
I'm trying to do a Dlookup with multiple items in the [Criteria] section and
it's not working. Here is the code:
Private Sub Role_AfterUpdate()
If Me.SKU = "UNCR-3" Then
[Rate] = DLookup("[Rate]", "[tblProjectRates]", "[Role]=
[tblProjectRates]![RoleName]" And "[ProjectID] =
[tblProjectRates]![ProjectID]")
Else
Me.Rate = [Text51]
End If
End Sub
I store rates in a table called [tblProjectRates] and the rate is tied to a
RoleName and the specific ProjectID. When the user updates the [role]
ComboBox in the form, I want it to automatically populate the [Rate] field
with the appropriate rate based on the ProjectID and the Role stored in the
Project Rates table.
Any code corrections would be much appreciated.
Thanks