new diffeculty! Inserting rows in datagrid!
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
DataGrid1.ClearFields
'sql = ("select * from AUH_HOUSE as a
sql = ("INSERT INTO AUH_HOUSE (HOUSE_ID) VALUES = '" & Trim(Text1.Text) & "'")
'sql = ("select a.HOUSE_ID, a.Owner_ID, a.Owner_Name, a.Area_name, a.Road_Name, a.Building_T, a.Building_A, o.Gender, o.Family_NO, o.Emirate_Code, o.No_buildings from AUH_HOUSE As a , Owner_Ship As o where a.Owner_ID = o.Owner_ID and a.HOUSE_ID = '" & Trim(Text1.Text) & "'")
'This specifies that the type of the ADODC is for SQL
Adodc1.CommandType = adCmdText
'This assigns the SQL result to the ADODC
Adodc1.RecordSource = sql
Adodc1.Refresh
'The result from the SQL will then be used
'to populate the datagrid
Set DataGrid1.DataSource = Adodc1
End If
End Sub

