If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Binding a textbox in a report to query field

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-20-12, 07:05
mox mox is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
Binding a textbox in a report to query field

Hello everyone,

I am new to MS Access and i am using access 2007 for a report that outputs various fields based on the outcome of the query. I have no problem with that as i have used a report wizard and the various textboxes for the respective fields appear on the "details" section of the report. The challenge is, i want to display the totals of the displayed fields on the textboxes which i have manualy added (did not use wizard) on the "reportfooter" section.

To be more concise, qryBatchProfile is a query that updates the report with the fields on the details section when a command button cmd_Preview is clicked. Then the second query, qryTotals is suposed to compute sums per field in qrybatchProfile and update the textboxes on the "reportfooter" section.

Now, when i click the command button to preview the report i get a dialog that requires me to enter the parameter value of qryTotals before the report is displayed. I understand that i have to set the recordsouce of my report to the two queries but the data tab on the property sheet is blank.this is the my code.

Private Sub cmdPreview_Click()
On Error GoTo Err_cmdPreview_Click

Dim stDocName As String
'
stDocName = "qryBatchProfile"
DoCmd.OpenQuery stDocName, , acEdit

stDocName = "qryTotals"
DoCmd.OpenQuery stDocName, , acEdit

'Me.Text27.Value = DCount("B_T", "Sum Of Blend Target(kg)")
'
stDocName = "rptProfileData"
DoCmd.OpenReport stDocName, acPreview

Exit_cmdPreview:
Exit Sub

Err_cmdPreview:
MsgBox Err.Description
Resume Exit_cmdPreview_Click

End Sub
Reply With Quote
  #2 (permalink)  
Old 01-20-12, 09:06
mox mox is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
binding textbox

thanks in advance. I've found my way. I used subreports.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On