C
Cyberwolf
Sorry I did it this way, but I did not get a response to my reply. See below
for full text.
OK That helped me find that the one side had to be fixed, but I put a watch
on REF_ and got <Expression not defined in Context> With the following code
and also on the [CurrentTB]![Line_] and got
<Accounts Receivable DB can't find the field '|' referred to in your
expression.>
Watch : : [CurrentTB].[Line_] : <Accounts Receivable DB can't find the
field '|' referred to in your expression.> : Variant/Integer :
Form_frm:Chargebacks.Line_Number_AfterUpdate
My 3 watch expressions are:
Watch : + : Me.[Line Number] : 1472250 : Object/Textbox :
Form_frm:Chargebacks.Line_Number_AfterUpdate
Watch : : REF_ : <Expression not defined in context> : Empty :
Form_frm:Chargebacks.Line_Number_AfterUpdate
Watch : : [CurrentTB].[Line_] : <Accounts Receivable DB can't find the
field '|' referred to in your expression.> : Variant/Integer :
Form_frm:Chargebacks.Line_Number_AfterUpdate
sqlStmt = "SELECT REF_, Amount FROM CurrentTB WHERE ([CurrentTB]![Line_] ="
& Me.[Line Number] & ");"
for full text.
OK That helped me find that the one side had to be fixed, but I put a watch
on REF_ and got <Expression not defined in Context> With the following code
and also on the [CurrentTB]![Line_] and got
<Accounts Receivable DB can't find the field '|' referred to in your
expression.>
Watch : : [CurrentTB].[Line_] : <Accounts Receivable DB can't find the
field '|' referred to in your expression.> : Variant/Integer :
Form_frm:Chargebacks.Line_Number_AfterUpdate
My 3 watch expressions are:
Watch : + : Me.[Line Number] : 1472250 : Object/Textbox :
Form_frm:Chargebacks.Line_Number_AfterUpdate
Watch : : REF_ : <Expression not defined in context> : Empty :
Form_frm:Chargebacks.Line_Number_AfterUpdate
Watch : : [CurrentTB].[Line_] : <Accounts Receivable DB can't find the
field '|' referred to in your expression.> : Variant/Integer :
Form_frm:Chargebacks.Line_Number_AfterUpdate
sqlStmt = "SELECT REF_, Amount FROM CurrentTB WHERE ([CurrentTB]![Line_] ="
& Me.[Line Number] & ");"
Ofer said:I can think of two reasons why this error will happen
1. The field name Line_ doesn't exist in the table
2. The Me.[Line Number] doesnt return any value
with 2 I can help, put a code break in the open recordset code (press F9)
when the code stop, check the value of Me.[Line Number]
--
The next line is only relevant to Microsoft''s web-based interface users.
If I answered your question, please mark it as an answer. It''s useful to
know that my answer was helpful
HTH, good luck
Cyberwolf said:When I excute the following code I get an error 3061 "Too few parameters.
Expected 2"
Private Sub Line_Number_AfterUpdate()
'On Error GoTo Line_Number_AfterUpdate_Err
Dim recSet As DAO.Recordset
Dim sqlStmt As String
Dim FOpenedRecSet As Boolean
sqlStmt = "SELECT REF_, Amount FROM CurrentTB WHERE (Line_ =" & Me.[Line
Number] & ");"
Set recSet = CurrentDb().OpenRecordset(sqlStmt)
FOpenedRecSet = True
If (Not (recSet.BOF And recSet.EOF)) Then
Me![Claim Number].Value = recSet.Fields(0).Value
Me!Amount.Value = recSet.Fields(1).Value
End If
'Line_Number_AfterUpdate_Exit:
'If (FOpenedRecSet) Then
' Set recSet = Nothing
' FOpenedRecSet = False
'End If
'Exit Sub
'Line_Number_AfterUpdate_Err:
' MsgBox Err.Description
' Resume Line_Number_AfterUpdate_Exit
End Sub