Display A Text Box On A Condition Of Another Text Box
Dec 6, 2006
I am trying to run a IF, THEN expression.
What I have created is :
Private Sub Form_Open(Cancel As Integer)
If Me!Type = "Workboat" Then Me!DWT.Visible = False
End
This works fine but where the TYPE field is enetred as another category other than workboat, the DWT field is still missing. Am I missing the Else part?
My database has Main form and a Sub form. On main form i place one unbound text box named investigations. In subform of which datasheet there is a column named TestCode. I want unbound text box (Investigations) to display row values which selected in a column (TestCode) of subform.for example:Investigation field should display "CBC,HB,ALP".
I'm trying to pull a date from a table into a text box on a form tab control using DLookup and I just can't figure out what is wrong with my DLookup expression:
=DLookUp("DateOrdered","tDateOrdered","PrNumber=" & [PrNumber]) ----- (DateOrdered is short date, PrNumber is text, db is split Access 2013)
Whats missing in this expression? I've tried every criteria variant I could find but to no avail.
I am trying to hide a text box based on the contents of another text box in the same report. Here is the code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If IsEmpty(Me.DocFullName) Then Me.Text55.Visible = False Else Me.Text55.Visible = True End If End Sub
i.e. I want Text55 to disappear if DocFullName is empty.
I thought my code was OK, but it refuses to co-operate.
I have a report which I would like to change the text of a field blue if a certain condition is met. What I want to happen on this report is if a specific field has an "Active" - then it will be in Blue text, otherwise it is in black text.
I have gone into the report ->in the Details section -> put a procedure in the On Format event. The code I have been trying is:
----- If Analysis_Status = Active Then Me.Analysis_Status.ForeColor = vbBlue Else Me.Analysis_Status.ForeColor = vbBlack End If End Sub ----
I have a report base on my table. Here a check box. I wanna show two label text hide/show base on when check is true or false. It will be when report will be open. I have try this but nothing is happened.
Code: If AffecteAc= True Then affected.Visible = True general.Visible = False End If
I'm having problems trying to get an If statement working on my form. What I have is a form with two combo boxes linked to a Calendar when you click on the arrow. I can get the dates I select from the calendar into the combo boxes which works perfectly. What I wanted to do then was create a textbox to list the number of days between each date. I have created an If statement for me to do this, which works fine. The problem I am having is that it doesn't seem to update these changes on the form after the date has been changed.
I have placed the code in the AfterUpdate event on both of the combo boxes and also in the Form Current Event.
Anyone any ideas?
If you want to see the If statement let me know, but I don't think it's that.
We have only 4 computers in our office. Our DB backend is SQL server and due to constant corruption of the database from multiple users, each user/computer runs its own separate copy of the mdb file.
I have set up a small form in a separate database to allow me to quickly compact the DB and copy it to the 4 locations on the network instead of doing it manually. This process works fine...BUT....I have a text box on the form set up to display the copy progress and the contents of the text box do not properly display during the file copying. Even though the code to change the value of the textbox comes before the file copy command, the textbox will not display the until after the copying is finished. However, when I step debug the process it displays the information correctly before the file copy command executes.
Here is a sample of my code... Dim strPath1 As String Dim strpath2 As String
If Dir("C:FortuneSystemFortune_System.ldb") <> vbNullString Then MsgBox "Cannot proceed! Fortune database is open.", vbCritical Exit Sub End If
txtProgress = "Compacting Database" 'compact master DB to a temporary DB file DBEngine.CompactDatabase "C:FortuneSystemFortune_System.mdb", strPath1 txtProgress = "" If chkTed Then If Dir(strpath2 & "Ted.ldb") <> vbNullString Then MsgBox "Ted cannot be copied. Program is running.", vbCritical Else Screen.MousePointer = 11 txtProgress = "Ted Copying" Kill strpath2 & "Ted.mdb" FileCopy strPath1, strpath2 & "Ted.mdb" txtProgress = "" Screen.MousePointer = 0 End If End If ....etc...
Can anyone explain why this is happening and possibly a way around it?
I tried to display a variable and constant onto a text box by putting =myvariable onto the data source of the text box. However, Access seems keep threating my variable as a data field and giving me error message. What to do with this?
Hello Guys, I am new to Access 2000 and issue is ,I have a field name product_name with datatype MEMO,when I chek my report at the place of product_name instead of the name of product it shows a squared symbol ,i dont understand how I can see the values of product_name.
SO anyone can help me out ,bcos of this I m stuck into my project.
Go nice and easy on me. This is my first serious DB and i've picked a cracker to start with.
Basically i am trying to set up a booking system for excursions, booking seats on coaches, trains, printing tickets, vouchers and information.
At the moment I'm trying to populate a text box (txtExcursionCost) in a form with a cost with is drawn from a table (tblExcursions).
tblExcursions holds information about the excursions including the info which populates combo box (cboExcursionTitle) and combo box(cboExcursionDate). The date combo is dependant on what is selected in the Title combo. The text box (txtExcursionCost) needs to be dependant on the Title and Date combos to get the right cost displayed. How could I get this to work?
The reason for the text box is that it only needs to be displayed to show the user the cost of that particular excursion and to create a base for a calculation for Amount Due at the completion of the transaction.
Let me start by saying I am very, very new to Access, but have been assigned a report to create.
I have the following textbox in my report: =[Location]+(Chr(13) & Chr(10)) & [callnumber]+(Chr(13) & Chr(10)) & [Online Availability]+(Chr(13) & Chr(10)) & [PF Subject]
I'm using this format so that my 4 fields appear in a list and don't leave blank lines if the one of the fields happens to be empty.
The problem is that I need to alter or substitute some text.
First, in the location field, I can have several different entries, but if the entry is 'Circ', I don't want that text to display and I don't want a blank line either.
Secondly, in the online availability field, if there is any value in the field, I want whatever text that is to change to something like 'Online - Yes'. If there is no value in the field, nothing should display.
I think the use of the Iif function should work, but I can't seem to write it correctly. Help!!
There are 2 images I am inserting, I want on the Access form to display the total of row (each row is batch number) in the box after pressing the button in the form. based on Product code, date and table numbers.
Hi All, I hope someone can help with this, I have 2 tables, 1 main table that holds all my part data ( ie part num, description, etc) and a second table with vendor info. On my Form I have all my fields that display the record. I placed a combo box on my form that I need the user to be able to select a vendor, which is working but I need the form to show the vendors part number in a field. The main table has a manufactures part number, and I have 3 fields that have my 3 vendors part numbers for that part in it. I have the combo box so that it shows the vendor name but how do I get it to look at a certain field for the vendor part number. Im still really new to Access and am clueless any help would be greatly appreciated. I know I have not explained this every well so I am attaching a sample of the DB so you can see that I have Thanks again
I have a tabular form in Access 2003 that is cutting off the text disply in some text fields.
I am doing some comparisons so the fields are repeated three times.
All three fields are larger than the data.
Two fields display correctly and the third field, identical to the other two, is chopped off on the right side and just shows empty space after the first few letters instead of all the data.
Fields are all the same size in the underlying table.
Changing the format between left, center, right has no effect.
Text size is the same in all three.
All the data is from a single query on a single form.
There is no subform.
All properties for the three are the same.
If I increase the field WAY beyond the required size all the data shows, but I haven't any extra room to do this on the form.
I have a field called PRICE and obviously it is a NUMERIC field as it need to perform calculations such as calculating Total Quantity * Price etc. At the moment the PRICE is inputted manually by the User on a Form and when it has no Price it is simple left blank.
What I wish to include is that on the REPORT when the field is empty it writes the text FOC instead of leaving it empty.
Can you please anyone suggest a way of doing this.
Hi, I have created a form (Form1) based on a table (Table1) and also a Query based on this table (Query1). I calculate a field in the query (Expr1: [column1] + [column2]) Now i have created a text box on Form1 that should display Expr1. I know I could also calculate the value directly via the expression builder, but I would prefer to simply display Expr1 from my query. Which is the syntax I have to use in the Expression Builder? I tried "= [Query1]![Expr1]" but it does not work. Thanks for your help Tigrou
i want to dispaly the weekday or the day of the month
i am using the formula =format([date],"d") for day or "ddd" for weekday in the text box but it is not returning the value that i want. returns #name// whats wrong with the formula
Say I have a form and the user inputs a date, say "21/02/2014" into a text box, how can I get another text box on the form to display the day afters date ("22/02/2014").
I'm sure its really easy but I cant seem to get it to work.