I know this is a free site and the moderators or anybody don't have to answer if they don't want to.. but if there is someone who knows how to answer this question please help with this one.
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 "BillDetail s" the connectionstrin g is connected to "BillDetail s" and the recordsource is to the table "DetailsT" which in the database i have these fields
The "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.
the datalist ADODC1 is connected to a database i have made with the "Visual Data Manager" called "BillInformatio n" the connectionstrin g is connected to "BillInformatio n" 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 "BOUNDCOLUM N" is to the "BILLID" which in the database i have these fields
The code for the DATALIST click event is this:
So there it is i hope i can get a response for this
lee123
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 "BillDetail s" the connectionstrin g is connected to "BillDetail s" and the recordsource is to the table "DetailsT" which in the database i have these fields
BillID
AmountDue
AmountPaid
DueDate
DatePaid
ReferenceNumber
BillBalance
AmountDue
AmountPaid
DueDate
DatePaid
ReferenceNumber
BillBalance
the datalist ADODC1 is connected to a database i have made with the "Visual Data Manager" called "BillInformatio n" the connectionstrin g is connected to "BillInformatio n" 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 "BOUNDCOLUM N" is to the "BILLID" which in the database i have these fields
BillID
BillName
Address
City
State
ZipCode
PhoneNumber
BillName
Address
City
State
ZipCode
PhoneNumber
Code:
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
Comment