G
Guest
I have a subform within a main form. Within the subform, if a user clicks on
a specific field, normally nothing happens like it should; however, if they
click on the very first column (line_item), it kicks them out of the screen
and gives the error: "compile error: variable not defined" and goes to the
row below and highlights-Contract_history. What am I doing wrong? Help
please!! I've looked at this all day with no luck. THANK YOU.
Private Sub Line_item_Click()
Dim rst_contractDetail As New ADODB.Recordset, SQLStmt As String
SQLStmt = "select contract_no,line_item,doc_type from
effective_contract_detail where contract_no = " & Me!Contract_no & " and
line_item = " & Me!Line_item
rst_contractDetail.Open SQLStmt, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
Do Until rst_contractDetail.EOF
If Not rst_contractDetail.EOF Then
contract_history.AddItem (rst_contractDetail!Contract_no & ";" &
rst_contractDetail!Line_item & ";" & rst_contractDetail!doc_type)
End If
rst_contractDetail.MoveNext
Loop
rst_contractDetail.Close
Set rst_contractDetail = Nothing
End Sub
a specific field, normally nothing happens like it should; however, if they
click on the very first column (line_item), it kicks them out of the screen
and gives the error: "compile error: variable not defined" and goes to the
row below and highlights-Contract_history. What am I doing wrong? Help
please!! I've looked at this all day with no luck. THANK YOU.
Private Sub Line_item_Click()
Dim rst_contractDetail As New ADODB.Recordset, SQLStmt As String
SQLStmt = "select contract_no,line_item,doc_type from
effective_contract_detail where contract_no = " & Me!Contract_no & " and
line_item = " & Me!Line_item
rst_contractDetail.Open SQLStmt, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
Do Until rst_contractDetail.EOF
If Not rst_contractDetail.EOF Then
contract_history.AddItem (rst_contractDetail!Contract_no & ";" &
rst_contractDetail!Line_item & ";" & rst_contractDetail!doc_type)
End If
rst_contractDetail.MoveNext
Loop
rst_contractDetail.Close
Set rst_contractDetail = Nothing
End Sub