|
-
Mar 22nd, 2002, 01:28 AM
#1
Thread Starter
New Member
adodb form displays
I have an app that's connecting to an access database. The recordsets from one table are being displayed in an MSFlexGrid. When one dblcliks on that record set or selects the recordset and clicks on a "details" command a form opens that displays the details in text boxes ready for edit. Of course then there's the update button that should update the database and refresh the flexgrid.
Here's the problem... When a recordset(18) is selected and the details form is displayed, the details form shows the details from the first recordset(1) in the table (regardless of what recordset was selected). As a result, ALL data in the form must be changed and updated or when the "update" command is clicked, the correct recordset(18) is updated with the data from the first recordset(1) that was displayed.
OK. Here's the code...
' opens the details form (frmCusDetails)
Private Sub cmdCustomerDetail_Click()
Load frmCusDetail
MSFlexGrid3.col = 0
frmCusDetail.updateProduct MSFlexGrid3.Text
frmCusDetail.Show vbModal
Form_Load
End Sub
'"updateProduct" shown above
Public Sub updateProduct(CustID As String)
Set cnDataBase = New ADODB.Connection
cnDataBase.Provider = "Microsoft.Jet.OLEDB.4.0;"
cnDataBase.ConnectionString = "persist security info=false;" _
& "data source=C:\clean soft\db1.mdb"
cnDataBase.Open
Set rsCustomer = New ADODB.Recordset
rsCustomer.Open "SELECT CustID, FName, LName, Address, City, Phone, [Cell Phone], Cleaner, Zip FROM tblCustomers", cnDataBase, adOpenDynamic, adLockOptimistic
rsCustomer.Find "CustID='" & CustID & "'"
CenterForm Me
End Sub
I hope you aren't as confused by this as I am. I'm gonna take a nap. This sucks.
Thanks for your help!
Scott
Last edited by bonginhao; Mar 22nd, 2002 at 01:59 AM.
-
Mar 22nd, 2002, 01:44 AM
#2
I'd guess it's something in your SQL Query String. Show us? and while ur at it... a bit of the code too.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|