Help date...

  • Thread starter Thread starter EMILYTAN via AccessMonster.com
  • Start date Start date
E

EMILYTAN via AccessMonster.com

Can't get the date calculated based on other table...
It just return me the value of calDate...



Private Sub Form_Current()Dim calDate As DatecalDate = CDate(Nz(Me.
cboCalibrationDate))Me!txtShelflifeExpiry = DateAdd("d", Nz(DLookup("Days",
"Inventory", "PartNumber=" & cboPartNumber), 0), calDate)End Sub
 
Is PartNumber a text field? If so, you need quotes around the value you're
passing:

Nz(DLookup("Days", "Inventory", "PartNumber='" & cboPartNumber & "'"), 0)

Exagerated for clarity, that's

Nz(DLookup("Days", "Inventory", "PartNumber= ' " & cboPartNumber & " ' "),
0)
 
thanks, can work already
Is PartNumber a text field? If so, you need quotes around the value you're
passing:

Nz(DLookup("Days", "Inventory", "PartNumber='" & cboPartNumber & "'"), 0)

Exagerated for clarity, that's

Nz(DLookup("Days", "Inventory", "PartNumber= ' " & cboPartNumber & " ' "),
0)
Can't get the date calculated based on other table...
It just return me the value of calDate...
[quoted text clipped - 3 lines]
Nz(DLookup("Days",
"Inventory", "PartNumber=" & cboPartNumber), 0), calDate)End Sub
 
Back
Top