theservant
Programmer
I have used the following code:
the question is how do i search a specific field in a Parent table. I have tried the where command, but get an error
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=MSDataShape;Data PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=H:\VideoMecca\Data\Customer_List.mdb;"
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "SHAPE {select Celnr,Password,IDNr,Surname,Name,Street_Address,Suburb,City,Code,Allowed_User1,Allowed_User2,ContractAmount,Friend1_Surname,Friend1_Name,Friend1_Tel,Friend2_Surname,Friend2_Name,Friend2_Tel from Customer_Info} AS ParentCMD APPEND ({select ID_Nr,VideoCode,VideoName,Date from Customer_Videos Order by VideoCode } AS ChildCMD RELATE IDNr TO ID_Nr) AS ChildCMD", db, adOpenStatic, adLockOptimistic
Dim oText As TextBox
'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next
Set grdDataGrid.DataSource = adoPrimaryRS("ChildCMD").UnderlyingValue
mbDataChanged = False
the question is how do i search a specific field in a Parent table. I have tried the where command, but get an error
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=MSDataShape;Data PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=H:\VideoMecca\Data\Customer_List.mdb;"
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "SHAPE {select Celnr,Password,IDNr,Surname,Name,Street_Address,Suburb,City,Code,Allowed_User1,Allowed_User2,ContractAmount,Friend1_Surname,Friend1_Name,Friend1_Tel,Friend2_Surname,Friend2_Name,Friend2_Tel from Customer_Info} AS ParentCMD APPEND ({select ID_Nr,VideoCode,VideoName,Date from Customer_Videos Order by VideoCode } AS ChildCMD RELATE IDNr TO ID_Nr) AS ChildCMD", db, adOpenStatic, adLockOptimistic
Dim oText As TextBox
'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next
Set grdDataGrid.DataSource = adoPrimaryRS("ChildCMD").UnderlyingValue
mbDataChanged = False