|
-
Feb 6th, 2007, 09:11 PM
#1
Thread Starter
Lively Member
Urgent Data Report Problem
VB Code:
[SIZE=3]
Private Sub cmdPrint_Click()
Dim rsPrint As New ADODB.Recordset
Set rptStore.DataSource = rsPrint
rptStore.DataMember = rsPrint.DataMember
strSQL = "SELECT * FROM StorePOS WHERE Flag <> 'D'"
rsPrint.Open strSQL, Conn, adOpenKeyset, adLockOptimistic
rsPrint.Filter = "ID = " & txtFields(txtID_StoreID).Text & " "
'Set Textbox Datafields
With rptStore.Sections("Section6").Controls 'Section is the section you create in datareport
.Item("txtCompleteAddress").DataField = rsPrint.Fields("CompleteAddress").Name
.Item("txtID").DataField = rsPrint.Fields("ID").Name
.Item("txtStoreName").DataField = rsPrint.Fields("StoreName").Name
.Item("txtMotherStore").DataField = rsPrint.Fields("MotherStore").Name
.Item("txtOwnershipType").DataField = rsPrint.Fields("OwnershipType").Name
.Item("txtDateOpened").DataField = rsPrint.Fields("DateOpened").Name
.Item("txtStoreType").DataField = rsPrint.Fields("StoreType").Name
.Item("txtStatus").DataField = rsPrint.Fields("Status").Name
.Item("txtNew").DataField = rsPrint.Fields("New").Name
.Item("txtStatusDate").DataField = rsPrint.Fields("StatusDate").Name
.Item("txtTransferred").DataField = rsPrint.Fields("TransferredFrom").Name
End With
rptStore.Refresh
rptStore.Show 1
[/SIZE]
I have this code but I got error message "Datafield "(Empty)" not found." This is done without Data Environment. Please help me with the code. Thanks.
-
Feb 7th, 2007, 01:45 AM
#2
Re: Urgent Data Report Problem
The DataField property of one or more controls on the report has not been set.
-
Feb 7th, 2007, 08:25 PM
#3
Thread Starter
Lively Member
Re: Urgent Data Report Problem
 Originally Posted by brucevde
The DataField property of one or more controls on the report has not been set.
How can I set the Datafield? Please help me with the code. Thanks.
-
Feb 8th, 2007, 02:03 AM
#4
Re: Urgent Data Report Problem
Are you kidding? You posted code that does just that!
-
Feb 8th, 2007, 07:10 AM
#5
Re: Urgent Data Report Problem
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|