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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSAccess ObjectFrame properties appearing "sometime later"

Status
Not open for further replies.

fivesidecube

Programmer
Nov 10, 2006
1
GB
I have a VBA script in MSAccess 2003 and I'm having some problems. Within the report's open event I'm trying to adjust a MSGraph.Chart's RowSource property. This sometimes works and sometimes doesn't.

The problem occurs with the assignment line "Graph32.RowSource"... the application raises error# 2455. If I play around with the watches (not changing values, just changing what I'm watching) in the debugger and hit run a few times, the assignment will just work with the adjusted RowSource.

Any ideas why it is taking time to get the properties?

The script:
Code:
Private Sub Report_Open(Cancel As Integer)
Dim rs As Recordset
Dim fldNumb As Integer
Dim sqlReq As String

Set rs = Application.CurrentDb.OpenRecordset("Question Averages Labelled_Crosstab")
sqlReq = ""

For fldNumb = 2 To rs.Fields.Count - 1
    sqlReq = sqlReq & ",[" & rs.Fields(fldNumb).Name & "]"
Next fldNumb

rs.Close

sqlReq$ = "SELECT Null AS Expr " & sqlReq$ & " FROM [Question Averages Labelled_Crosstab];"
Graph32.RowSource = sqlReq
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top