R
Rafi
I have a switchboard on which I have a textbox CurrQ which I need to update
on open with a value as defined by
Select Max(tbl_IDD_Revenue.Qtr) As Qtr from Tbl_Idd_Revenue.
I have tried the On Open event of the form with the following code
stSQL = "Select Max(tbl_IDD_Revenue.Qtr) As Qtr from Tbl_Idd_Revenue"
Set db = CurrentDb()
Set rst = db.OpenRecordset(stSQL)
With rst
If Not (.EOF And .BOF) Then
Qtr = rst.Fields("Qtr")
End If
.Close
End With
me.CurrQ = Qtr
on open with a value as defined by
Select Max(tbl_IDD_Revenue.Qtr) As Qtr from Tbl_Idd_Revenue.
I have tried the On Open event of the form with the following code
stSQL = "Select Max(tbl_IDD_Revenue.Qtr) As Qtr from Tbl_Idd_Revenue"
Set db = CurrentDb()
Set rst = db.OpenRecordset(stSQL)
With rst
If Not (.EOF And .BOF) Then
Qtr = rst.Fields("Qtr")
End If
.Close
End With
me.CurrQ = Qtr