Must Trick To BackColor Textbox

Apr 4, 2006

I open form and get parameter in the openArgs

I have a tabular Form
and I want change the color if the ID is aqual.

for example:
I open the form like this:

DoCmd.OpenForm "frmMessageShow", , , "fID=" & Me.fID, , , Me.AssighmentId
[the Me.AssighmentId is the openArgs]

I want in the second form to color the textbox if AssighmentId = me.openargs

I try do it:
If Me.AssighmentId = Me.OpenArgs Then
AssighmentId.BackColor = vbRed
End If

and its not work :mad:

is there is an option to do it?

thanks!

View Replies


ADVERTISEMENT

Can You Trick An Autonumber??!!

Aug 26, 2007

Is there a way to do this -

I have surgical operations which are each given an AutoNumber id. To simplify my example - a patient can have a leg operation, an arm operation, a neck operation. All these are linked to the PatientID but they all have a different surgicalID. All these operations are follow-up and the follow-up data is linked to the surgeryID.

I have now realised that the patient may come back for a repeat operation on the leg. Is there a way I can add this operation without it being assigned a newSurgicalID number. Obviously if I use add a new record it gives me a new AutoNumber. Any way around this?

Thanks for any help or suggestions

View 5 Replies View Related

[Trick] Amount In Words

Mar 3, 2005

Make Table Name: tblnum




Fields:

1.num (for number)(Feed 1 to 99)

2.inword (for In words)(Feed One to Ninty Nine)

Make Module



Public Function inwords(amount As Variant) As String




Dim intlac As Integer

Dim intTh As Integer

Dim intHun As Integer

Dim intNum As Integer

Dim strLac As String

Dim strTh As String

Dim strHun As String

Dim strNum As String

Dim intlen As Integer

intlen = Len(amount)

Select Case intlen

Case 7

intlac = Left(amount, 2)

intTh = Mid(amount, 3, 2)

intHun = Mid(amount, 5, 1)

intNum = Right(amount, 2)

strLac = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intlac) & " Lac"

If intTh = 0 Then

strTh = ""

Else

strTh = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intTh) & " Thousand"

End If

If intHun = 0 Then

strHun = ""

Else

strHun = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intHun) & " Hundred"

End If

If intNum = 0 Then

strNum = ""

Else

strNum = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intNum)

End If

Case 6

intlac = Left(amount, 1)

intTh = Mid(amount, 2, 2)

intHun = Mid(amount, 4, 1)

intNum = Right(amount, 2)

strLac = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intlac) & " Lac"

If intTh = 0 Then

strTh = ""

Else

strTh = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intTh) & " Thousand"

End If

If intHun = 0 Then

strHun = ""

Else

strHun = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intHun) & " Hundred"

End If

If intNum = 0 Then

strNum = ""

Else

strNum = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intNum)

End If

Case 5

intTh = CInt(Left(amount, 2))

intHun = CInt(Mid(amount, 3, 1))

intNum = CInt(Right(amount, 2))

strTh = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intTh) & " Thousand"

If intHun = 0 Then

strHun = ""

Else

strHun = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intHun) & " Hundred"

End If

If intNum = 0 Then

strNum = ""

Else

strNum = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intNum)

End If

Case 4

intTh = CInt(Left(amount, 1))

intHun = CInt(Mid(amount, 2, 1))

intNum = CInt(Right(amount, 2))

strTh = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intTh) & " Thousand"

If intHun = 0 Then

strHun = ""

Else

strHun = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intHun) & " Hundred"

End If

If intNum = 0 Then

strNum = ""

Else

strNum = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intNum)

End If

Case 3

intHun = CInt(Left(amount, 1))

intNum = CInt(Right(amount, 2))

strHun = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intHun) & " Hundred"

If intNum = 0 Then

strNum = ""

Else

strNum = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intNum)

End If

Case 2

intNum = CInt(Right(amount, 2))

strNum = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intNum)

Case 1

intNum = CInt(Right(amount, 2))

strNum = DLookup("[inword]", "tblNum", "[tblNum]![num]=" & intNum)

End Select

inwords = strLac & " " & strTh & " " & strHun & " " & strNum & " Only"

End Function
Result = inwords(Number TextBox)

View 2 Replies View Related

Front/back End Speed-up Trick - Can Anyone Clarify This?

Nov 23, 2006

I found this snippet in a thread on a forum I don't subscribe to. I think I understand what it's saying but can anyone expand on the how's and why's please?

'Your front end maintains any attachments to the backend (ie first form open opens a recordset on the backend to force the backend ldb file to remain for the session - a known trick to speed up FE-BE setups) '

View 5 Replies View Related

BackColor Property

May 8, 2007

hello,

I have a txtBox. Its backColor property changes according to what I do on the form. Now, when I close the form and reopen it, the backColor is not the same one with which the form was closed.

Ex. red, green
if I close the form having the backColor = green, then when I reopen it, it changes to red.

Can anyone tell me what I am missing

Thank you

View 4 Replies View Related

Datasheet Backcolor

May 15, 2006

Hi,

Is there a way to set the background color of a datasheet? I don't mean the color of the cells, but the datasheet itself outside of the rows/columns as shown below (dark grey color):

http://img.photobucket.com/albums/v368/flemmo/datasheet.gif

Thanks

View 1 Replies View Related

Changing Backcolor

Dec 13, 2004

Hoi,

When i'm select a record, i want to change the background color of all textfield in that record.
Does someone know how to do this?

greetings
koen

View 2 Replies View Related

Backcolor In Text Field For Each Record

Apr 10, 2005

Hello,

I have the following code for changing the back-color of a field:

Private Sub txttekst1_AfterUpdate()

Dim lngRed As Long
Dim lngGreen As Long

lngGreen = RGB(0, 255, 0)
lngRed = RGB(255, 0, 0)

If Me.txttekst1 < 100 Then
Me.txttekst1.BackColor = lngRed
ElseIf Me.txttekst1 > 200 Then
Me.txttekst1.BackColor = lngGreen
End If

End Sub

Problem: When I change to record to record the back color is not
the same as I have write the code.

mulderm

View 4 Replies View Related

BackColor Property Of Command Button

Jan 3, 2007

Hi all,

Is it possible to change the Background color of a command button?

Whan I right click in the properties of the command button I cannot see a BackColor property. Further, when I programatically try to change the BackColor property in VBA I get an error message.

Thanks in advance
Kabir

View 1 Replies View Related

Change Backcolor Of 'built' Control Number

Dec 20, 2005

I have a randomized table named tblRandomBoxes with the following data:

ID RandomID
1 4
2 5
3 2
4 6
5 1
6 3

I have 6 command buttons named command1,command2,command3, etc. and 6 Labels named Label1,Label2, Label3, etc. On Click of each command button, I want to lookup the ID based on the RandomID and set the backcolor of that label number to a different color.

ie) on command1 click me.Label4.backcolor = 39835

How can I 'build' the label number with the lookup? Here's the code I'm trying, but it doesn't recognize my 'built' label number:


Private Sub command1_Click()
Dim ctl As Control
ctl = "Label" & DLookup("ID", "tblRandomBoxes", "RandomID = 1")
Me.ctl.BackColor = 39835
End Sub

Thanks,

Sup

View 6 Replies View Related

Modules & VBA :: Change Form BackColor With CMD Button

Mar 2, 2015

I am trying to change form backcolor with a cmd button via VBA.

View 6 Replies View Related

Modules & VBA :: Form Header And Detail Backcolor Error

Jul 10, 2013

A user requested a change that would change the form header and detail back ground color to white when they click the button print record and then change the color back all in one click after the record prints. I keeping getting a run time error, type mismatch on the line where to code is to be changed. The colors are numbers not vbColors. I am using Access 2007.

Code:
Me.FormHeader.BackColor = "#FFFFFF"
Me.Detail.BackColor = "#FFFFFF"

View 3 Replies View Related

Tables :: Repaint BackColor Based On Data Entered

Sep 25, 2014

I am trying to color code text boxes based on the data entered in. The column is "PHASE" and the items entered in are either "1" "2" or "3". 1 is supposed to be Red, 2 Yellow, 3 Green.

I have Microsoft Access XP (I'm sure). I've tried to do it on VB and had no luck. I couldn't figure out Macro and I don't have On Click or Code Builder.

I have tried a couple of different expressions and no luck. I'm definitely an amateur to Access. I'm only using it cause it's what we have in the office.

View 8 Replies View Related

Modules & VBA :: Conditional Formatting - Backcolor Determined By Color Value Stored In A Cell

Jul 21, 2015

I would like to know if this is possible using VBA ( or other method)

I want to determine the back color o a cell based on a color value stored in another cell in other word

backcolor of cell A = the value of cell B

So if I change the numbers of cell B (which is color codes) , backcolor of cells A change accordingly and it will have the color specified in cell B.

View 4 Replies View Related

"LastName, Firstname" Trick

Mar 7, 2006

This is a useful trick: If you use a + to concatenate strings then it propogates nulls, if you use a & it doesn't...

So in the expression:

rec![LastName] & (", " + rec![FirstName])

If rec![FirstName] is Null then the expression (", " + rec![FirstName]) will be too, but the rec![LastName] & (Null) part won't be. This neatly drops the comma and space if the firstname is Null

Much better than:

rec![LastName] & iif(isnull(rec![FirstName]), "", ", " + rec![FirstName])

Steve.

View 6 Replies View Related

General :: Conditional Formatting - Change Backcolor Of Process If Status Field Contains Certain Text

Jan 8, 2014

I have a subform with two fields [status] and [process], i am trying to get the backcolor of procces to change to red if the status field contains the text "expired".

I have tried vba. plced on the after update

if me.status = "expired" then
me.process.backcolor = vbred
else me.process backcolor = vbwhite
end if
this

Changes the color of the field [process] but also all process field colors to red even if the status field does not contain "expired".

I think conditional formatting is the way to go but i think i need an expression to complete this.

View 7 Replies View Related

Forms :: Change Backcolor Of A Field On Current Record Displayed In Multiple Items Form

Apr 8, 2013

I wish to change the backcolor of a field on a current record being dispalyed in a 'multiple items' form. However when using me.A.backcolor = makes refrence to all fields called A on the 'multiple items' form and therefore all fields change colour not just the current record.

View 2 Replies View Related

Forms :: Update Unbound Textbox In Main Form From Subform Textbox Afterupdate

Apr 17, 2015

How to update unbound textbox on main form from unbound textbox in subform afterupdate.

that is when amount paid is updated it automatically updates total paid, balance etc.

View 2 Replies View Related

Pass Value From Unbound Textbox To Bound Textbox

Oct 26, 2006

Hi: There are two textboxs in my main form. One is bound and another is unbound. There is no entry in the unbound textbox as values come into automatically after entering some information in the subform. My question is how to i pass values from unbound textbox to bound textbox every time when the value change in unbound textbox i need to change the value in the bound textbox. When the form load there is already value in the bound textbox which i want to override based on the values from the unbound textbox.

Thank You.

View 2 Replies View Related

Forms :: Date And ID Number - Textbox Value To Another Textbox

Oct 12, 2014

I have a date textbox (Week_Ending) and number textbox (Staff_ID) in a form (frmHourEnter), when both have values I open another form (frmStaffReport) with textboxes (txtDateStart and cmbStaff).

How do I open the second form with the values of the first form pre-entered?

View 12 Replies View Related

Forms :: Date Form Textbox To Textbox?

Jan 24, 2015

I have a database for billing. In my database, I have a form that consists of a main form "Order" and 2 subforms "OrderDetails" and "Customer" OrderDetails are to enter the products to be connected to the Order. All function super, but I want to have some information from one of the forms "copied" over to on of the others.

Here is what I would like

In the subform "OrderDetails" I have made a textbox that summarize all prices to a total, his tekstbox i called "Tekst31". I would like the amount in this textbox to appear in a field "Bel�b" in the main form "Order".

I have tried some different commands, but nothing has worked, also I have made a query which dose the same ting as the tekstboks, as the information in that tekstbox it not stored anywhere.

View 2 Replies View Related

Copying From 1 Textbox To Another Textbox On Different Forms

Jan 29, 2006

I have a text box on 'Forma' & a textbox (named text3) on 'Formb'.
I want to copy the contents of the textbox from 'Formb' to the textbox on 'Forma'. I have used the following code in the textbox on 'Forma'....

=Forms![Formb]![Text3].text

This doesn't seem to be working whether both Forms are open or only 'Forma'. Could somebody please advise as to what I am missing. Your assistance is very much appreciated.

View 4 Replies View Related

Getting A Textbox To Populate Based On Another Textbox

Mar 18, 2005

Dear All:

I have created a form using access 2000. So far, this form already has data and dates in a combox in this format: mm/dd/yyyy.

In the AfterUpdate of the date combobox, I did this:

If graduation_date = #2/1/2004# then
Text_Graduation_date = "dated this first day of february two thousand four."
End If
End Sub

In addition, I have defined many other dates as well using the code above. It works well when I choose the date form the combobox, the other textbox populates, but there are so many more dates in the combo!

Is there a way to auto-populate the textbox with the appropriate text as I scroll through the form?

Thanks,

Dion

View 5 Replies View Related

Forms :: Bringing Entered Data From One Textbox On Form To Textbox On Another Form

May 17, 2013

I currently have two froms, "add record" and "add record cont." The reason I have two seperate forms is because when clients create a new record information needs to be saved to two different tables and when creating one from with fields from both tables I ran into many problems. The two tables are named : tblMain, tblFileLoc Currently there is a textbox on both forms named "fileID" the FileID in the first form is from tblMain and is the primary key for that table, the FileID on the second form "Add Record Cont." is just a normal field. When clients enter in the new FileID in the first form "Add Record" and then move onto the next form "Add Record Cont." i need access to bring the entered FileID from the first form and Fill it in the FileID field in the second form. Currently I have tried making the control source for the textbox on the second form = the textbox on the first form but it brought up an error.

View 1 Replies View Related

Textbox To Populate Another Textbox

Aug 3, 2005

Dear All:

I have created a form with various textboxes. In one unbound textbox called Graduation_date, I input information and this is reflected in another bound textbox called text762.

However, as I scroll through the form, the information that is to be reflected in textbox 762 disappears.

Any ideas on how to apply the information entered in Graduation_date textbox to all?

Regards,

Dion

View 2 Replies View Related

Sum Value TextBox

Feb 24, 2005

Hello,

I have continous Form with TexBox. In TextBox is "Dsum" calculation.
How can I make Sum of Values TextBox. =Sum (TextBox) Don't work.
Please, help.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved