J
Jerry Natkin
I'm trying, in database moved from Access 2000 to 2007, to populate a
link table with pairs of random integers structured to be in
the range of the number of records in the master and detail tables.
The sub hangs, in compilation, on a seek. It says "Compile error: wrong
number of arguments or invalid property assignment."
I've never tried a seek on two variables before, but can't see any
problem. Can someone please help?
Thanks,
Jerry Natkin
***********************************************************************
Sub Build_random_test()
Dim intMasterID As Integer
Dim intDetailID As Integer
Dim rs1 As Recordset
Dim IntRecCount as integer
Set rs1 = CurrentDb().openRecordset("link_Master_Detail")
rs1.Index = ("Master_Detail")
intRecCount = 0
While intRecCount <501
intMasterID = Int(Rnd() * 42 + 1) ' 42 records in master
intDetailID = Int(Rnd() * 174 + 1) '174 records in detail
rs1.Seek "=", intMasterID, intDetailID
' line where error occurs
If rs1.nomatch Then
intRecCount = intRecCount + 1
rs1.Append
rs1.MasterID = intMasterID
rs1.DetailID = intDetailID
rs1.Update
End If
End While
End Sub
link table with pairs of random integers structured to be in
the range of the number of records in the master and detail tables.
The sub hangs, in compilation, on a seek. It says "Compile error: wrong
number of arguments or invalid property assignment."
I've never tried a seek on two variables before, but can't see any
problem. Can someone please help?
Thanks,
Jerry Natkin
***********************************************************************
Sub Build_random_test()
Dim intMasterID As Integer
Dim intDetailID As Integer
Dim rs1 As Recordset
Dim IntRecCount as integer
Set rs1 = CurrentDb().openRecordset("link_Master_Detail")
rs1.Index = ("Master_Detail")
intRecCount = 0
While intRecCount <501
intMasterID = Int(Rnd() * 42 + 1) ' 42 records in master
intDetailID = Int(Rnd() * 174 + 1) '174 records in detail
rs1.Seek "=", intMasterID, intDetailID
' line where error occurs
If rs1.nomatch Then
intRecCount = intRecCount + 1
rs1.Append
rs1.MasterID = intMasterID
rs1.DetailID = intDetailID
rs1.Update
End If
End While
End Sub