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

Missing properties in VB

P: n/a
Hi

I'm having a little stupid problem when trying to change properties in
a Textbox (or a label) using Event Procedures.

Im doing a report and want to change the Control Source in a textbox,
depending of the result from a query, but the Control Source is not
avalible in the listbox when typing: me.txttesting. <-- now a listbox
is apering but I cant chose the Control Source property.
The same is when trying to change the Caption in a Label.

I know that I have done it before, but it is a long time ago, and I
cant remember if it a prefence or an Add-in Im missing...

Im using Access 2002

Best regards
John K
Denmark
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 13 Aug 2004 06:28:07 -0700, jk******@hotmail.com (John Kristensen)
wrote:

Go ahead and finish the statement manually. I'm pretty sure it will
work.

-Tom.

Hi

I'm having a little stupid problem when trying to change properties in
a Textbox (or a label) using Event Procedures.

Im doing a report and want to change the Control Source in a textbox,
depending of the result from a query, but the Control Source is not
avalible in the listbox when typing: me.txttesting. <-- now a listbox
is apering but I cant chose the Control Source property.
The same is when trying to change the Caption in a Label.

I know that I have done it before, but it is a long time ago, and I
cant remember if it a prefence or an Add-in Im missing...

Im using Access 2002

Best regards
John K
Denmark


Nov 13 '05 #2

P: n/a
On 13 Aug 2004 06:28:07 -0700, John Kristensen wrote:
Hi

I'm having a little stupid problem when trying to change properties in
a Textbox (or a label) using Event Procedures.

Im doing a report and want to change the Control Source in a textbox,
depending of the result from a query, but the Control Source is not
avalible in the listbox when typing: me.txttesting. <-- now a listbox
is apering but I cant chose the Control Source property.
The same is when trying to change the Caption in a Label.

I know that I have done it before, but it is a long time ago, and I
cant remember if it a prefence or an Add-in Im missing...

Im using Access 2002

Best regards
John K
Denmark


You can't rely on Intellisense.
In a report, the PageBreak control does not show a visible property,
but it does have one.

For a label you can use:
LabelName.Caption = "A new caption"

You can change a report control's control source in the Report's OPEN
event:
[ControlName].ControlSource = "='This is a new control source text'"
or...
[ControlName].Controlsource = "=[SomeField]"
(Note the inclusion of the second = sign within the quotes.)

HOWEVER, in a report, you cannot change the control source property of
a control while the report is running (i.e. from within the detail
events).

It seems to me you should either use an unbound control with an
expression as control source:
=IIf([FieldName] = "xyz","Print this","Print that")

or use an unbound control and give it a value in the Detail Format
event:
If [FieldName] = "xyz" Then
[ControlName] = "Print this"
Else
[ControlName] = "Print that"
End If

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #3

P: n/a
RE/
avalible in the listbox when typing: me.txttesting. <-- now a listbox
is apering but I cant chose the Control Source property.
The same is when trying to change the Caption in a Label.

I know that I have done it before,


When that has happened to me, it was always because of some error in the rest of
the VB code. Try a compile and see if it compiles.
--
PeteCresswell
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.