Re: Using VBA need to add a text box to a form
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Mon, 22 May 2006 18:51:05 +0800
Look okay.
Form tblExcel_Check must be open in design view.
The form must have a textbox (or combo) named txtCurrent, and another
control named GroupOrderNo.
The acEqual operator will be ignored.
What error are you receiving?
Another way to get the result you are after is to manually add the format
condition (via Format | Conditional Formatting), and then testing what
Access gave you. Open the Immediate Window (Ctrl+G), and enter:
? Forms!tblExcel_Check.txtCurrent.FormatConditions.Count
? Forms!tblExcel_Check.txtCurrent.FormatConditions(0).BackColor
and so on to understand what is there.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Trever B" <TreverB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B4F355F7-4197-4720-9CF5-7638B5D85293@xxxxxxxxxxxxxxxx
Hi,
Trouble's back
Still can't get this right.
Currently I have:
txtCurrent = "F" & Fieldss
Forms!tblExcel_Check.txtCurrent.FormatConditions.Add acExpression,
acEqual, "[GroupOrderNo]=1",
Forms!tblExcel_Check.txtCurrent.FormatConditions.Item(0).BackColor =
15592886
I have a defination problem.
Can you be good enough to correct it for me.
"Allen Browne" wrote:
This example adds a format condition to the text box named Amount on
Form1,
to show negative values in red:
With Forms!Form1.Amount.FormatConditions
.Add acFieldValue, acLessThan, 0
.Item(.Count - 1).ForeColor = vbRed
End With
"Trever B" <TreverB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1AF62A77-E21E-46C5-A6CE-0F6F616D14AF@xxxxxxxxxxxxxxxx
Sorry Alan,
Just a bit thick on this point. how do a do add method if possible give
an
example
Regards.
Trev.
ps I am always glad when you reply as you always give the best, most
correct
and to the point answers.
"Allen Browne" wrote:
If the control is a TextBox or ComboBox, you can use the Add method of
its
FormatConditions collection to add up to 3 format conditions.
"Trever B" <TreverB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:13EC3E5A-F8B6-4BFD-BA68-AE09164A0505@xxxxxxxxxxxxxxxx
Thanks for that.
How for the follow up.
Is it possible at the time of adding the item to put a conditional
format
in
place.
If so, How.
If not how do I get around it.
Thanks
Trev
"Allen Browne" wrote:
You cannot do this while the form is in use, so this technique is
not
suitable for any database where you plan to release an MDE for
users.
If you are designing some kind of wizard/tool for development
purposes,
you
can create a text box like this (assuming Form1 is open in design
view):
Dim txt As TextBox
Set txt = CreateControl("Form1", acTextBox, acDetail, , , _
1440, 1440, 1440, 285)
txt.Name = "MyNewControl"
"Trever B" <TreverB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B1EFA54B-E78D-4CD4-9E32-5B5732E185CF@xxxxxxxxxxxxxxxx
Hi,
Thanks in advance.
Using VBA I want to a boxes to a form.
I am ok with the loop but just how do you add a textbox to a form
using
code.
.
- Follow-Ups:
- Re: Using VBA need to add a text box to a form
- From: Trever B
- Re: Using VBA need to add a text box to a form
- References:
- Re: Using VBA need to add a text box to a form
- From: Allen Browne
- Re: Using VBA need to add a text box to a form
- From: Allen Browne
- Re: Using VBA need to add a text box to a form
- From: Trever B
- Re: Using VBA need to add a text box to a form
- From: Allen Browne
- Re: Using VBA need to add a text box to a form
- From: Trever B
- Re: Using VBA need to add a text box to a form
- Prev by Date: Re: Using VBA need to add a text box to a form
- Next by Date: Re: Input Mask: SB-01
- Previous by thread: Re: Using VBA need to add a text box to a form
- Next by thread: Re: Using VBA need to add a text box to a form
- Index(es):
Relevant Pages
|
Loading