If IsNull(Me!GroupNumber) Then
' no lGroupNumber, so no rated values. This should not happen
Exit Sub
Else
ThisGroupNumber = Me!GroupNumber
End If
' Return reference to current database:
Set dbs = CurrentDb
strsql = " SELECT tblphotometery.GroupNumber, tblphotometery.LampNumber, tblphotometery.SupplyVoltage, tblphotometery.LampVoltage, tblphotometery.LampCurrent, tblphotometery.LampWattage, tblphotometery.LuminousFlux " _
& " From tblphotometery" _
& " WHERE (tblphotometery.GroupNumber=" & ThisGroupNumber & ")" _
& " ORDER BY tblphotometery.GroupNumber, tblphotometery.LampNumber;"
Set rst = dbs.OpenRecordset(strsql, dbOpenSnapshot) ’总是报错说 Too few arameters.Expected 1.
If rst.BOF And rst.EOF Then 'sql语句没有问题,可以查到想要得结果,为何在窗体中就显示不出来呢?
' no records with rated data found. Exit sub without doing anything.
Exit Sub
Else
rst.MoveLast ' if there are more than 1 records with rated data for a lamp code
Set frmChild = Forms!frmMeasuredValue_sub ' then we use the last one.
With frmChild