Connecting Tech Pros Worldwide Forums | Help | Site Map

Referencing a form within a report

aw
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi MVP's,

I was trying to write an assignment declaration within my report that would
reference an active form:

Private Sub Report_Activate()
Dim src AS Forms
Set src = [MyForm]

TextBox = src![Subject1] & " / " & src![Subject2]

(I was hoping this would be better than typing 'Forms![MyForm]![Subject1]'
some 20 times!)

Alas, this only produces error messages such as "Data missmatch".

Any information will be greatly appreciated...


--
Thanks a million!

James Fortune
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Referencing a form within a report


aw <aw@spam.is.nul> wrote in message news:<c666ddb6b9632b8d0f34be3504593e70@news.1usene t.com>...[color=blue]
> Hi MVP's,
>
> I was trying to write an assignment declaration within my report that would
> reference an active form:
>
> Private Sub Report_Activate()
> Dim src AS Forms
> Set src = [MyForm]
>
> TextBox = src![Subject1] & " / " & src![Subject2]
>
> (I was hoping this would be better than typing 'Forms![MyForm]![Subject1]'
> some 20 times!)
>
> Alas, this only produces error messages such as "Data missmatch".
>
> Any information will be greatly appreciated...[/color]

I had success with:

Dim src As Form

Set src = Forms![MyForm]
With src
TextBox = ![Subject1].Value & " / " & ![Subject2].Value
End With

James A. Fortune
aw
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Referencing a form within a report


James Fortune wrote:
[color=blue]
> aw <aw@spam.is.nul> wrote in message
> news:<c666ddb6b9632b8d0f34be3504593e70@news.1usene t.com>...[color=green]
>> Hi MVP's,
>>
>> I was trying to write an assignment declaration within my report that
>> would reference an active form:
>>
>> Private Sub Report_Activate()
>> Dim src AS Forms
>> Set src = [MyForm]
>>
>> TextBox = src![Subject1] & " / " & src![Subject2]
>>
>> (I was hoping this would be better than typing
>> 'Forms![MyForm]![Subject1]' some 20 times!)
>>
>> Alas, this only produces error messages such as "Data missmatch".
>>
>> Any information will be greatly appreciated...[/color]
>
> I had success with:
>
> Dim src As Form
>
> Set src = Forms![MyForm]
> With src
> TextBox = ![Subject1].Value & " / " & ![Subject2].Value
> End With
>
> James A. Fortune[/color]

Thanks James, I'll give it a go...


--
Thanks a million!
James Fortune
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Referencing a form within a report


aw <aw@spam.is.nul> wrote in message news:<c666ddb6b9632b8d0f34be3504593e70@news.1usene t.com>...[color=blue]
> Hi MVP's,[/color]

Oops. I didn't notice that. I'm not trying to make it look like I'm
an MVP. I apologize for any confusion this may have caused.

James A. Fortune
rkc
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Referencing a form within a report



"James Fortune" <jafortun@oakland.edu> wrote in message
news:a6ed3ce7.0408011213.131d360e@posting.google.c om...[color=blue]
> aw <aw@spam.is.nul> wrote in message[/color]
news:<c666ddb6b9632b8d0f34be3504593e70@news.1usene t.com>...[color=blue][color=green]
> > Hi MVP's,[/color]
>
> Oops. I didn't notice that. I'm not trying to make it look like I'm
> an MVP.[/color]

It would be really sad if that thought actually crossed anyone elses mind.


aw
Guest
 
Posts: n/a
#6: Nov 13 '05

re: Referencing a form within a report


James Fortune wrote:
[color=blue][color=green]
>> Hi MVP's,[/color]
>
> Oops. I didn't notice that. I'm not trying to make it look like I'm
> an MVP. I apologize for any confusion this may have caused.
>
> James A. Fortune[/color]

If your suggestion fixes the problem, then you can consider yourself an
MVP; at any rate, there really is no need to apologize.


--
Thanks a million!
James Fortune
Guest
 
Posts: n/a
#7: Nov 13 '05

re: Referencing a form within a report


aw <aw@spam.is.nul> wrote in message news:<28407ebb8ba7531728eca09facd87ede@news.1usene t.com>...[color=blue]
> James Fortune wrote:
>[color=green][color=darkred]
> >> Hi MVP's,[/color]
> >
> > Oops. I didn't notice that. I'm not trying to make it look like I'm
> > an MVP. I apologize for any confusion this may have caused.
> >
> > James A. Fortune[/color]
>
> If your suggestion fixes the problem, then you can consider yourself an
> MVP; at any rate, there really is no need to apologize.[/color]

Sure I do. I need to apologize for such a bizarre post. It was made
at 6 a.m. after working most of the night. rkc's comments were on the
mark. I respect the knowledge of most of the MVP's and much of what I
know I learned from posts by MVP's on this NG. Part of the beauty of
this NG is that lots of people who have spent the last 10 years
working in Access have gotten to know different aspects of Access
quite well. When we put that knowledge together we all gain immensely
from that diversity. I add to that diversity because I've done some
things that few Access programmers have done :-). I try hard to
understand the problems people are having and can often provide useful
answers. In the minds of the people I've helped I'm at least a VP
when the suggestion fixes the problem.

James A. Fortune
Closed Thread