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!

Access generic Report

Status
Not open for further replies.

Avacha

Technical User
Apr 1, 2002
69
US
Please help!
I'd Like to Create generic Report,But I can not assigh
Data to Text box on "details Report"
This is code:
If [Forms]![FrmMenuReport]![FrmReport] = 1 Then
Me.LblReportName.Caption = "General Information"
Me.LblReportSort.Caption = "Sorted By Facility"
Me.lblReportPageHeaderSort.Caption = "SORTED BY FACILITY IN ASCENDING ORDER"
Me.LblFirst.Caption = "Report Date"
Me.Labelsec.Caption = "Last name"
Me.Labelt.Caption = "First name"
Me.LabelFour.Caption = "Book&Case Number"
Me.Labelsix.Caption = "FACILITY"
If RS.EOF And RS.BOF Then
MsgBox "No match for this selection.", vbOKOnly + vbInformation
Exit Sub
Else
Do Until RS.EOF
txtData.ControlSource = RS.Fields"Facility")
STRText = STRText & RS.Fields("Facility")
RS.MoveNext
Loop
txtData = strdate

ElseIf [Forms]![FrmMenuReport]![FrmReport] = 2 Then
Me.LblReportName.Caption = "Gender"
Me.LblReportSort.Caption = "Sorted By Gender"
Me.lblReportPageHeaderSort.Caption = "SORTED BY GENDER IN ASCENDING ORDER"
Me.LblFirst.Caption = "FACILITY"
Me.Labelsec.Caption = "Last name"
Me.Labelt.Caption = "First name"
Me.LabelFour.Caption = "Book&Case Number"
Me.Labelfif.Caption = "GENDER"
Me.Labelsix.Visible = False
If RS.EOF And RS.BOF Then
MsgBox "No match for this selection.", vbOKOnly + vbInformation
Exit Sub
Else
RS.MoveFirst
RS.MoveLast
'txtData.RowSource = RS.RecordCount - 1
'txtData.Height = RS.RecordCount - 1 * 3
'txtData.with = Len(RS.Fields("FACILITY"))
Do Until RS.EOF
'txtData.Caption = txtData.Caption & RS.Fields("FACILITY") & vbCrLf
'txtData.ControlSource = "tyttyuqwt" 'RS.Fields("FACILITY")
'txtData.Caption = "dgsfjsdgfjsd"
'STRText = STRText & RS.Fields("FACILITY") & vbCrLf
RS.MoveNext

Loop
'txtData.Caption = STRText
End If
End If
[COLOR==red]I tried txtData=txtData & RS.Fields"Facility")& vbcrlf
and txtdata=txtData & RS.Fields("Facility")
Evry time I get msg "You can't assigh a value to this object"[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top