G
Guest
Entering data in a form, field is unbound. When I tab/enter into the field
and exit the field, the value is still not populated. 'Sometimes', if I
click on the field the value shows up. What's going on? The code is below:
Private Sub BeginBalance_Enter()
On Error GoTo BeginBalance_Enter_Err
Dim rs As Recordset
DoCmd.OpenQuery "QuerytoPopulateTablewithTotalNet", acViewNormal, acReadOnly
Set rs = CurrentDb.OpenRecordset("Select * From [TableContainingTotalNet]",
dbOpenDynaset) ' only a single record
With rs
[BeginBalance] = ![TotalNet] ' Get Balance from TableContainingTotalNet
End With
BeginBalance_Enter_Exit:
Exit Sub
BeginBalance_Enter_Err:
MsgBox Error$
Resume BeginBalance_Enter_Exit
End Sub
Would it be best to get the value straight from the query? If this is the
"best" approach, then how?
and exit the field, the value is still not populated. 'Sometimes', if I
click on the field the value shows up. What's going on? The code is below:
Private Sub BeginBalance_Enter()
On Error GoTo BeginBalance_Enter_Err
Dim rs As Recordset
DoCmd.OpenQuery "QuerytoPopulateTablewithTotalNet", acViewNormal, acReadOnly
Set rs = CurrentDb.OpenRecordset("Select * From [TableContainingTotalNet]",
dbOpenDynaset) ' only a single record
With rs
[BeginBalance] = ![TotalNet] ' Get Balance from TableContainingTotalNet
End With
BeginBalance_Enter_Exit:
Exit Sub
BeginBalance_Enter_Err:
MsgBox Error$
Resume BeginBalance_Enter_Exit
End Sub
Would it be best to get the value straight from the query? If this is the
"best" approach, then how?