Populating MS Access Report from VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a MS Access report using VBA to access data from a SQL
Server table and a DB2 table. Both tables contain varchar data that I want
to appear on the report. When I try linking the table, Access does not like
the DB2 varchar data. The VBA method was suggested as the most efficient.

I can get the query to bring back data from SQL Server in VBA but I can't
seem to get the data to populate the text boxes on the report. I keep
getting an error when I use this code:

Me.ErrorType = rst!ErrorType

What am I doing wrong? Any help would be appreciated.
 
Hi,
What error you get?
try to use textbox name other that field name, if report bound to same table
this can cause a conflict
 
The error I get is "Run-time error '-2147352567 (80020009)' You cannot assign
a value to this object". I do not have the report bound to any table or
query. Nor is any control bound to any fields or queries.

Thanks for your help.
--
Thanks
Shirley


Alex Dybenko said:
Hi,
What error you get?
try to use textbox name other that field name, if report bound to same table
this can cause a conflict
 
Try the Me!ErrorType=rst!Me.ErrorType
perhaps ErrorType is a reserved word

Alex

Shirley Gilreath said:
The error I get is "Run-time error '-2147352567 (80020009)' You cannot
assign
a value to this object". I do not have the report bound to any table or
query. Nor is any control bound to any fields or queries.

Thanks for your help.
 
Back
Top