C
Cyberwolf
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
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