By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,550 Members | 2,757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,550 IT Pros & Developers. It's quick & easy.

Fetching Data Fields from VBA

P: n/a
dot
I have a simple, but I think, strange problem:

I have created a simple database with a table and a report based on that
table. I created the following code for the report:

Option Compare Database

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
MsgBox Me.ID
End Sub

But it fails:
Run-time error '2465':
Microsoft Office Access can't find the field 'ID' referred to in your
expression.

I have also tried with "!" instead of "." - I don't know the difference.

Can anyone tell me what I'm doing wrong?
Jan 17 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
dot
OK after many hours of messing around I finally found out I had to add
the actual field onto the form and then hide it. Darn it. I thought I
had tried that before.

dot wrote:
I have a simple, but I think, strange problem:

I have created a simple database with a table and a report based on that
table. I created the following code for the report:

Option Compare Database

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
MsgBox Me.ID
End Sub

But it fails:
Run-time error '2465':
Microsoft Office Access can't find the field 'ID' referred to in your
expression.

I have also tried with "!" instead of "." - I don't know the difference.

Can anyone tell me what I'm doing wrong?
Jan 17 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.