i bought a book and it gives examples on certain controls and this one is with two datagrids, but when you use the code it doesn't work. in this code i used the BIBLIO.MDB to make this work but it keeps on giving me an error and points to the Refresh part can anyone tell me what is going on here
here is what i have on my form I have two ado controls. as you can see there are called "adoPublish ers" and "adoTitles" and the two have "pubID" in them I also have Two datagrids. On publishers when i click on a certain one, the titles datagrid is suppose to show me all the titles for that "pubID" but it dont. how can i get this code to work properly or am i doing this code wrong?
Code:
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer) Dim pstrSQL As String pstrSQL = "SELECT * FROM Titles " & _ "WHERE pubID = '" & _ adoPublishers.Recordset![pubID] & "'" adoTitles.RecordSource = pstrSQL adoTitles.Refresh End Sub