i have changed my project so many times to try to get the results i want but can't seem to get this one thing to work the datagrid and datalist to work right. i have looked on the web to see if i could do it another way. and read so many books but there isn't another way i have found i have searched this site but nothing but the posts i have left and certainly i won't find the answers there. Because it only has the same question posted. so i guess i will go through my question again.
I have made a program so when i pay a bill i can click on the name of the bill in the datalist. and only them bills for that name will show in the datagrid.
the way i have this set up is, i have TWO ADODC controls on the form. and one datagrid and one datalist.
the first ADODC control is for the DATALIST and the second ADODC control is for the DATAGRID.
the datagrid ADODC2 is connected to a database i have made with the "Visual Data Manager" called "BillDetails" the connectionstring is connected to "BillDetails" and the recordsource is to the table "DetailsT" which in the database i have these fields
BillIDThe "BillID" I have made a text field because i want to add my own ID's. I don't know if you can do this but i have.
AmountDue
AmountPaid
DueDate
DatePaid
ReferenceNumber
BillBalance
the datalist ADODC1 is connected to a database i have made with the "Visual Data Manager" called "BillInformation" the connectionstring is connected to "BillInformation" and the recordsource is "SELECT * FROM DetailsT" the "ROWSOURCE" is to the ADODC1. the "LISTFIELD" is set to the "BILLNAME" the "DATASOURCE" is to ADODC1 the "DATAFIELD" is to "BILLNAME" the "BOUNDCOLUMN" is to the "BILLID" which in the database i have these fields
BillIDThe code for the DATALIST click event is this:
BillName
Address
City
State
ZipCode
PhoneNumber
Expand|Select|Wrap|Line Numbers
- Private Sub Datalist1_Click()
- Dim strQuery As String
- strQuery = "Select * FROM DetailsT WHERE BillID = " & _
- DataList1.BoundText & "'"
- With Adodc2
- .RecordSource = strQuery
- .Refresh '<-----------'This is where i am getting the error
- 'it's not refreshing the datagrid
- End With
- With DataGrid1
- .ClearFields
- .ReBind
- End With
- End Sub
lee123