I am trying to use the following to populate a form text box:
Dim sqlLot As String
sqlLot = "SELECT val(lot_num]) AS NewLot FROM
Raw_Matrl_Receipt_Table
GROUP BY Raw_Matrl_Receipt_Table.Lot_Num
HAVING (((Raw_Matrl_Receipt_Table.Lot_Num) Is Not Null))ORDER BY Val([lot_num]) DESC';"
If IsNull(Me!Lot_Num) Then
Me!Lot_Num = DMax("NewLot", sqlLot) + 1
End If
---
If I define sqlLot as String, I get an error stating that the input query or table cannot be found.
If I use Double or Integer, I get a type mismatch error.
Dim sqlLot As String
sqlLot = "SELECT val(lot_num]) AS NewLot FROM
Raw_Matrl_Receipt_Table
GROUP BY Raw_Matrl_Receipt_Table.Lot_Num
HAVING (((Raw_Matrl_Receipt_Table.Lot_Num) Is Not Null))ORDER BY Val([lot_num]) DESC';"
If IsNull(Me!Lot_Num) Then
Me!Lot_Num = DMax("NewLot", sqlLot) + 1
End If
---
If I define sqlLot as String, I get an error stating that the input query or table cannot be found.
If I use Double or Integer, I get a type mismatch error.