私はこのためにVisual Basic for Applications(VBA)を使用することをお勧めします。
新しいモジュールを作成し、データを入力するプロシージャを作成します。 比較的簡単です - すべてのユーザーをループして親テーブルを更新する必要があります。
私のコードでは、クエリ結果(空の "User"フィールド)を持つテーブルが1つあり、すべてのユーザーを保持する別のテーブルがあると仮定しています(フィールド名 "UserName"を使用)
Public Sub PopulateUsers()
Dim dbs As DAO.Database
Dim rstUsers As DAO.Recordset
Dim rstComputers As DAO.Recordset
' Open up our tables
Set dbs = CurrentDb
Set rstUsers = dbs.OpenRecordset("Users")
' If there are no users then complain and quit
If rstUsers.EOF Then
rst.Close
MsgBox "There are no users to populate", vbInformation, "Error"
Set rstUsers = Nothing
Exit Sub
End If
Set rstComputers = dbs.OpenRecordset("ComputerUsers")
' Loop through all of our computer records
Do Until rstComputers.EOF
rstComputers.Edit
rstComputers!User = rstUsers!UserName
rstComputers.Update
rstUsers.MoveNext
If rstUsers.EOF Then
rstUsers.MoveFirst
End If
rstComputers.MoveNext
Loop
' Close tables
rstUsers.Close
rstComputers.Close
' Clear object references to free up memory
Set dbs = Nothing
Set rstUsers = Nothing
Set rstComputers = Nothing
debug.print "Users Populated"
End Sub
Ctrl + Gを押して直接ウィンドウを開き、「PopulateUsers」と入力することができます。
出典
2016-10-01 19:09:37
DHW
わかりません。テーブルにはレコードはありませんが、次に58行のテーブルが記述されています。 – Parfait
彼は列にはレコードがないと言いました - 私は彼が意味するのは、レコードがあり、そのユーザーの列がすべて空白/ヌルであるということだと思います – DHW