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.
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.
Hi all. Question: On a new record, what is the value of a text box prior to it being updated? I have tried to check and it is neither Null or Zero or "".
Basically, I have a text box on my form linked to a field on my table(the field is defined as number). In addition I have two check boxes also tied to their respective table.
I need to make the following happen:
Allow the form to close when 1) Both the text box and the check boxes are empty and/or unchecked. (on a new record) 2) The text box contains a numeric value and one of the check boxes is checked.
I can make the #2 work, but not #1. Any ideas, suggestions? Thank you.
I have a table here tblTemp with a field client. This table can have from 1 to 100 records at times as it keeps getting cleared for the purpose of this exercise.
I also have a form frmLabel1Data with an unbound text box txtclient.
I was hoping to get the first record of the table into this text box upon opening the form.
I tried creating a query which gave me the following sql;
SELECT First(tblTemp.client) AS FirstOfclient FROM tblTemp;
I also tried placing it in this code with no luck
Private Sub Form_Open(Cancel As Integer)
Dim SQL
SQL = "SELECT First(tblTemp.client) AS FirstOfclient FROM tblTemp;" MsgBox SQL
End Sub
Does anyone know why I cannot see the same result as when I open the query it gives me my client name but the code above does not????
I want to show some text from another table based on the values of the bound fields in each record of a continuous form. I thought it would be easy, but I can't get it to work.
I step through the records in the bound recordset and use some of the values to query another table. Then I use the value from the query to populate the unbound text field.
It works fine for each record. But every time the unbound field is updated, all the records in the continuous form are updated.
I'm stuck on this one. It's probably something simple to fix - if you know what to do!
I have a report based on a query. I want to populate 6 Text Boxes with Dates from fields in another query. The date fields I want to add will be headings for columns that represent weeks (they change all the time so can�t be hard figures). The two queries are not really related by any common field. I am not able to get this working because the fields I want are not part of the query that is the Record Source for the Report.
Is there any way that I can do this? Can I change the record source of just the text boxes?
My form used to work and as I kept adding event scripts now when I click on the ID text field, it doesn't open the linked record, but a blank record with 'Filtered' showing on the bottom navigation. I guess a question I have is,
-is there an order on which the procedure scripts run -do they all run everytime, or just the specific event script
=================================== Private Sub Company_Click() DoCmd.OpenForm "frm Company", , , "[ID] = " & [ID] DoCmd.Close acForm, "frmCompanyDirectory" End Sub ===================================
I used to have code on a button on the "frmCompanyDirectory" that added a new record to "frm Company" and that's when the ID = ID stopped working.
I have designed a database that has two forms as inputs to a table. The first form is a checklist and when it is completed it saves all fields except the ManagerID field. I then use the blank ManagerID, clientID and Date to pull onto a form for the manager to complete. On completion I want the ManagerID to save into the current records so they do not show up in the manager checklist forms and I then have a complete record. I have been searching online and cant seem to see how the best avenue is. I have an append query, see below
Code: INSERT INTO ChecklistResults ( ManagerID ) SELECT ChecklistResults.ManagerID, ChecklistResults.ClientID, ChecklistResults.DateCompleted FROM ChecklistResults WHERE (((ChecklistResults.ClientID)=[Forms]![TeamLeader]![ComClientNotFin]) AND ((ChecklistResults.DateCompleted)=[Forms]![TeamLeader]![ComDateSelect]));
Code: Private Sub CmdAppend_Click() Dim dbsNorthwind As dao.Database Dim rstAmend As dao.Recordset Dim qdfAmend As dao.QueryDef
I have 4 fields that are unbound on a form. img1 img2 img3 img4..When these are entered they are all combined and autofill another unbound textbox = imagename.. what i would like to do is from this unbound textbox 'imagename' ..i would like to populate a textbox that IS bound called FileName
[Event Procedure] Private Sub imagename_Click() Me.imagename = Me.FileName End Sub
When I add ANY record to a Table I get meaningless symbols in a Text Field on my Report.I have a Microsoft Access Database of College Football Teams and their Schedules that otherwise works just fine. In the past, I regularly added new teams to the Teams Table. I enter Team Name, Conference and Division affiliation (if any), whether or not they play home games on Grass or Turf and a hyperlink to the team's website.
I went to add Fordham to my Teams Table, as Fordham plays at Temple this week. After I entered the information in the Table, I saved and ran the Compact and Repair Database tool. I went to run a Report that contains a text field called "Comments" that I enter non-indexed comments about the game manually in the Schedule Table or on a Form. Not all games have comments. However, as a result of entering Fordham in the Teams Table, I now get nothing but weird looking symbols that look like Wing-Dings or Chinese Script in the Comments column on the report. These symbols show up in each row under Comments, whether or not I actually have a comment in the field. These symbols also show up on the report no matter what team or time period I select on the Form that runs a Query that generates the Report.
I isolated the problem to this addition of Fordham, because if I delete the Fordham record from the Teams Table, Save and Compact and Repair the Database, I can return to the normal looking text in the Comments Text Field in the Report. I tried only entering "Fordham" as the team name, disregarding any of the other information, like Conference, Division, playing surface or (most importantly) the hyperlink, but I get the same symbols. I also tried entering just a team name of something other than Fordham, but the same pesky symbols show up. I restored a previous version of this database before the problem showed up, but, when I added Fordham, I got the same result. I tried searching on this topic, but with little luck. There were a few things like making sure the hyperlink was not indexed or Unicode Compression was off, but nothing really more than that.
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.
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):
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.
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
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.
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.
I have a text box in a form (unbound) and when I go to add text into it, the text carries over from one record to another but I want it to be exclusively for that record.
We need to move rich text from an Access memo field to a Word text box. So far the best Ive been able to come up with is in the code below. In this code pprs!What is a record set field of a table memo field that is bound to a text box enabled for rich text. The rich text seems to be stored as html as so I can get word to convert it by enclosing it in html tags.
Dim What As Word.Shape Set What = doc.Shapes.AddTextbox(msoTextOrientationHorizontal , doc.PageSetup.LeftMargin, 225, 534, 0) Dim sPath As String sPath = "G:Temp.html" Open sPath For Output As 1 Print #1, "<HTML>" & pprs!What & " </HTML>" Close #1 What.TextFrame.TextRange.InsertFile (sPath)
I have a single field in a table called "Client Contact", where users enter a semicolon between the name, address, and city state & zip. My reason for this was so we could copy client info with a single copy and paste (like from an email). But, on the final report, it needs to have these three parts split up into different lines, or even different textboxes. I can't find a way to do that.
I have a Form Display Data in my Access Database, which is working really well. However, users was asking if there is a way we can make Font Color Could/would change if The text in A field or Any field in my display form contained the word "SAD or MAD". Is there code for such thing in display form?..