can anybody tell me why Bold statement is not working.

Private Sub Command2_Click()
Dim a As String
a = MsgBox("You want to Modify....?", vbQuestion + vbOKCancel, " MODIFY")
If a = vbOK Then
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
[B]rs.Open "select mr.srno,mr.productname,mr.qty, mr.unit from mrtemp as mr Order by mr.srno where mr.req_no=" & strlistrequest, con, adOpenDynamic, adLockOptimistic[/B]
If Not rs.EOF Then
Set Form6.DataGrid1.DataSource = rs
Form6.Show vbModeless
Else
MsgBox "Record not found"
End If
End If
End Sub

now i add & ",now i am getting another error the connection cannot
be used to perform this operation. it is either closed or invalid in this
context.

rs.Open "select mr.srno,mr.productname,mr.qty, mr.unit from mrtemp as mr order by mr.srno where mr.req_no=" & strlistrequest & ", con, adOpenDynamic, adLockOptimistic"

try changing the query to

rs.Open "select srno, productname, qty, unit from mrtemp order by srno where req_no=" & strlistrequest & " order by srno", con, adOpenDynamic, adLockOptimistic

Now i replaced into these stat. But got syntax error.
error.doc

rs.Open "select srno, productname, qty, unit from mrtemp order by srno where req_no=" & strlistrequest & " order by srno", con, adOpenDynamic, adLockOptimistic

Attachments

sorry about that take out the first order by srno and that should fix it

rs.Open "select srno, productname, qty, unit from mrtemp where req_no = " & strlistrequest & " order by srno", con, adOpenDynamic, adLockOptimistic

Actually i am from U.A.E i am making project currently on
procurement.can you tell me how shoud i edit and update data
grid information using update button.
Hints.doc

Attachments

did this problem get solved? if so mark it as solved so if others run into a problem then can see the solution and create another thread for a different problem

This question has already been answered. Start a new discussion instead.