Form won't compile on some PC's but will on others

G

Guest

I have noticed a weird behavior of Access that I can't understand. I have a
form where I make reference in code to a field such as:
Me.Transaction_Src = "Manual Entry"

Since Transaction_Src is a field in the underlying record source, the form
compiles just fine on my computer, even if I don't have a hidden control
called 'Transaction_Src' bound to that respective field on the form.
However, when I deliver the app to someone else, the compiler stops on that
line of code.

I have been able to fix the problem by just adding the hidden control on to
the form and it compiles on both PC's. This has happened to me before but it
is not consistent.

Can anyone shed some light on this inconsistent behavior. It's driving me
crazy because I can't find any logical reason why a corresponding control for
each field that is referenced is required on some forms but not on others.
 
J

Jeff L

I have had the same sort of thing happen. I will create a form,
reference one of my fields and get an error. I did what you did....add
the field to the form. Then I wanted to see what would happen if I
deleted the field again from the form. When I ran my code after
deleting it, it worked fine! Not sure if this is the same situation
for you or not, but perhaps it is something to try.
 
G

Guest

I have no problem leaving the hidden control on the form, but it's
interesting that once it has been on the form the reference works, even after
deleting it. I have found this behavior of Access to be very annoying. I
would love someone from Microsoft to explain how this can happen.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top