Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Command8_Enter()
Dim rs As DAO.Recordset
Dim Str, SQL, updtSQL As String
SQL = "Select * From Table1"
Set rs = CurrentDb.OpenRecordset(SQL)
Str = "[ID]= " & Me.Table2_subform![ID]
rs.FindFirst (Str)
If rs.NoMatch Then
rs.AddNew
rs("ID") = Me.Table2_subform![ID]
rs("1") = Me.Table2_subform![a]
rs.Update
Else
rs.Edit
rs("ID") = Me.Table2_subform![ID]
rs("1") = Me.Table2_subform![a]
rs.Update
End If
rs.Close
Set rs = Nothing
End Sub
currentdb.execute "insert into table1(id,[1])Select id,a From table2 left join table1 on table1.id=table2.id where table1.id is null
Insert Into Table1([1],id) Select Table2.a, Table2.ID From Table2 Left Join Table1 on Table1.ID = Table2.ID Where Table1.ID is null
SQL = "Insert Into Table1([1],id) Select Table2.a, Table2.ID From Table2 Left Join Table1 on Table1.ID = Table2.ID Where Table1.ID is null"
updtSQL = "UPDATE Table1 INNER JOIN Table2 ON Table1.id = Table2.ID SET Table1.id = Table2.id, Table1.[1] = Table2.a"
CurrentDb.Execute (SQL)
CurrentDb.Execute (updtSQL)