Passing over Requery
- From: "Jenny at APOC" <JennyatAPOC@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 13 Apr 2005 10:40:11 -0700
I have a form, with a list box that has a query for the rowsource. The User
selects a command button that is supposed to take the selected value away
from the list box by updating a table then requerying the listbox.. I have
this working on a different form so I cannot understand what I did so
differently. The commented out code is the code that works. Why would
something not requery?
Private Sub CloseaCarton_Click()
Dim stFCarton As String
On Error GoTo Err_CloseaFCarton_Click
'capture the carton number from the list
stFCarton = AvailableFCartonList.Value
'Now construct insert statment
SQLStmt = "UPDATE FileCartonTable SET Carton Status = FASLE " & _
"WHERE (FileCartonNbr = " + CStr(stFCarton) + ")"
'Now execute SQL and insert
DoCmd.RunSQL (SQLStmt)
'Now refresh list box
Me.AvailableFCartonList.Requery
Err_CloseaFCarton_Click:
If IsNull(AvailableFCartonList.Value) Then
MsgBox "You must select an FC to Close", vbOKOnly, "Closing FCs"
End If
'
' 'capture the box number from the list
' stBoxNbr = AvailableBoxList.Value
'
''Now construct insert statment
' SQLStmt = "UPDATE BoxTable SET BoxStatus = FALSE"
' SQLStmt = SQLStmt + " WHERE (BoxNbr = " + CStr(stBoxNbr) + ")"
'
'
' 'Now Execute SQL and insert
' DoCmd.RunSQL (SQLStmt)
'
' 'Now refresh list box
' AvailableBoxList.Requery
'
' 'If available box list is null
'Err_Closeabox_Click:
'If IsNull(AvailableBoxList.Value) Then
' MsgBox "You must select a box to close", vbOKOnly, "Closing Boxes"
' End If
'
End Sub
.
- Follow-Ups:
- RE: Passing over Requery
- From: '69 Camaro
- RE: Passing over Requery
- Prev by Date: Determining number of records returned...
- Next by Date: Re: Combo Box -- saving data to multiple feilds
- Previous by thread: Determining number of records returned...
- Next by thread: RE: Passing over Requery
- Index(es):