Martyh
Registered User.
- Local time
- Today, 10:34
- Joined
- May 2, 2000
- Messages
- 196
Hi all,
I am using MS Access 2010.
I am trying to create a form that will change the captions in another form. See Fig 1. There are only 2 procedures: Load and Close
1) Q1.1.1 is the command button with the correct caption put in to place. (cmdQ1)
2) The [Caption] row is the caption that I would make the changes to (tCaption01)
3) The [Question No] row is irrelevant to the problem.
When I open the form, the unbound text (tCaption01) reads the data from fQuestions_Trial_2 (the other form):
When I close the form, it checks to see whether the 2 “captions” are not equal, and makes the change if so.
Here is my problem:
The first time into the form there seems to be no problem, but then I haven’t changed any of the captions, just got the existing captions from the other form.
However, on subsequent times thru the form, I get the error “Run time error 2450: MS Access cannot find the referenced form “fQuestions_Trial_2”. “ - This is the form that I am getting the captions from. See Fig 2.
I can remedy the problem by going into the form in Design mode and decompiling/recompiling the form (“fQuestions_Trial_2”), however no where can I find a place where I can do the same thing in code.
Question: Is there a way to compile the form BUT IN CODE, or is there something else that I am missing?
Thanks,
Marty
PS Sorry about the not including any code -- rules!!
I am using MS Access 2010.
I am trying to create a form that will change the captions in another form. See Fig 1. There are only 2 procedures: Load and Close
1) Q1.1.1 is the command button with the correct caption put in to place. (cmdQ1)
2) The [Caption] row is the caption that I would make the changes to (tCaption01)
3) The [Question No] row is irrelevant to the problem.
When I open the form, the unbound text (tCaption01) reads the data from fQuestions_Trial_2 (the other form):
Code:
Me.tCaption01 = Forms!fQuestions_Trial_2!cmdQ1.Caption
When I close the form, it checks to see whether the 2 “captions” are not equal, and makes the change if so.
Code:
If Me.tCaption01 <> Me.cmdQ1.Caption Then
Forms!fQuestions_Trial_2!cmdQ1.Caption = Me.tCaption01
End If
The first time into the form there seems to be no problem, but then I haven’t changed any of the captions, just got the existing captions from the other form.
However, on subsequent times thru the form, I get the error “Run time error 2450: MS Access cannot find the referenced form “fQuestions_Trial_2”. “ - This is the form that I am getting the captions from. See Fig 2.
I can remedy the problem by going into the form in Design mode and decompiling/recompiling the form (“fQuestions_Trial_2”), however no where can I find a place where I can do the same thing in code.
Question: Is there a way to compile the form BUT IN CODE, or is there something else that I am missing?
Thanks,
Marty
PS Sorry about the not including any code -- rules!!