Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference a Field from the Current Record in Detail_Format Subroutine

Status
Not open for further replies.

DaveInIowa

Programmer
Dec 2, 2003
576
US
Is there any way to reference a field value in the Detail_Format subroutine as shown below? I know I can set the ControlSource property of controls on the report and access the values this way but I'd like to avoid this "blackbox" movement of data and get some better control of processing the data before printing it.

Code:
Private Sub Report_Open(Cancel As Integer)
        
    Me.RecordSource = "SELECT fld1, fld2 FROM table1"

End Sub

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

    [COLOR=green]' How do I reference the current value of fld1 or fld2 within this sub?[/color]

End Sub
 
The only method that I am aware of is to bind a control to the field. It doesn't have to be visible.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top