Recordsource

biscuit72

New member
Local time
Today, 23:42
Joined
Oct 1, 2003
Messages
5
I need to define a reports recordsource in the Report_Open procdure as I do not want to bind any of the controls in the detail section.

How do i do that and how do i referance the recordsource fields in the detail_formatat procedure of the report?

Thanks
 
should be simply:

Me.RecordSource = "qryMyQuery"

or, you can write the entire SQL

i.e.

Me.RecordSource = "SELECT * FROM qryMyQuery;"



The controls are basically the same:


Me.txtMyTextbox.ControlSource = "MyField"
 
I have set the recordsoucre as:

Private Sub Report_Open(Cancel As Integer)

Dim strSql As String

strSql = "SELECT tbl_Catalog.* " & _
"FROM tbl_Catalog " & _
"ORDER BY tbl_Catalog.Vendor, tbl_Catalog.Path, tbl_Catalog.ProdName, tbl_Catalog.Price;"

Me.RecordSource = strSql

End Sub

I am trying to assign a variable in the detail section as:

VarUPC = UPC 'field in table Catalog

It seems to be returning an null value.

thoughts?

Thanks for your help!
 
bisuit72,

No answer here, but please enlighten a curious newbie... I see "UPC" in your code, which tells me you're using a universal product code, perhaps from a barcode scanner... am I reading this correctly?

[Again, just curious]
 
Yes, I am using a UPC code but the codes come from our distributors via a .csv file. No bar code scanner on our end. Would be an easy way to get the UPC into a database.
 

Users who are viewing this thread

Back
Top Bottom