How can I fill a text box in a report with data from a secondary table.
This doesn't work:
Private Sub Report_Open(Cancel As Integer)
Dim selstr As String
Dim db As Database
Dim TRrec As Recordset
MsgBox "Load Tax Rate"
Set db = CurrentDb()
selstr = "Select DistinctRow [TR_Tax].[TR_TaxRate] from [TR_Tax]"
Set TRrec = db.OpenRecordset(selstr, dbOpenDynaset)
If TRrec.RecordCount = 0 Then
MsgBox "There are no records in TR_Tax"
Exit Sub
End If
rpttax_rate = TRrec(0)
End sub
get error "You can't assign a value to this object"
help??
This doesn't work:
Private Sub Report_Open(Cancel As Integer)
Dim selstr As String
Dim db As Database
Dim TRrec As Recordset
MsgBox "Load Tax Rate"
Set db = CurrentDb()
selstr = "Select DistinctRow [TR_Tax].[TR_TaxRate] from [TR_Tax]"
Set TRrec = db.OpenRecordset(selstr, dbOpenDynaset)
If TRrec.RecordCount = 0 Then
MsgBox "There are no records in TR_Tax"
Exit Sub
End If
rpttax_rate = TRrec(0)
End sub
get error "You can't assign a value to this object"
help??