Modules & VBA :: Applying One Text Box Value To Collection Of Another Text Box
Mar 25, 2015
I have a form with tabular format containing a text box with the name of session and text box with the name of classSession. This form containing multiple records but when i want to copy the value of session to the classSession text box the copy function is only applied to the first record and not applying to another records.
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 form on which there is a series of text box controls relating to different frequencies. At the moment I enter a value in to each of these manually.
However, I would like to have an unbound text box where I can paste in all the values (6 or 8 of them) from excel and then press a button and they would be copied in to the individual boxes.
So far I have my design:
I'm not sure where to start with regard to the code as I don't know how to handle delimited text - is it column delimited in excel?
I imagine some sort of loop, such as a do until will be required but again not sure.
I'm trying to figure out at what point an error message occurs while a database is closing. This problem only occurs if someone clicks on the red close button on the top right of the screen when there are several forms open. If the user exists normally there is NO problem.
I am attempting to use the print statement to write to a text file to track what is happening as the database shuts down. Unfortunately, the open (print) statement, when issued, zaps any prior contents which precludes having a full printed record. I am hoping for a print syntax that would allow appending.
Code: Open "ErrorReport.txt" for Output as #1 Appended text to the file to show what is happening in that event. Close #1
The program, in closing, does stop with an error message that a certain file can't be found. But when I click on debug, the program simply closes. I have also commented out VBA references to the file that can't be found, but the error still persists .
When I did the first import I did it by doing an import text file, located the file 1.txt. The Import Text Wizard opened and I picked Fixed With so I could break out the information myself.After dividing that information I hit advanced and changed the field name to match what they should be. Next, then it ask me to save Import Steps and I said yes.
First: how I can use the saved import to import this file again using the text wizard Second: how can I set it so it imports a numbers of files, maybe one or maybe all 30? Third: how difficult would it be to all the file name in the first or last column?
I am trying to make use of the OpenForm command to open a form to a record where a textbox matches the value of a text box on another form.
On Form1, I have a textbox called txtRtnRef, and it contains a reference number in a similar format to SWR-9
On Form2, I have a textbox called txtReOrderRef (control source ReOrderRef) which also contains a reference number in the same format (SWR-9)
I am trying to have a button next to the text box on Form1 that has an OnClick Event that opens Form2 to the record containing the same text reference number.I have tried, to no avail, a number of variations of the OpenForm command, the most recent being
I have a master/child forms. in master form sale_id,collection notes are placed. and in child form all collection details like collectionnumber,date,etc., child form look like datasheet view.
When i select the record from the list depending on the sale_id all the collection records shown in datasheet view form. If no record is there ok. if more than one records are there in collections of sale_id.i need count of records in collection depending on sale_id and also if i select one row in collection, notes to be shown for that record when i clik on shownotes button.
If more than one record in collection automatically it increment. how many collections for the sale_id. collection number would be increment. How and also show notes depending on collection number and sale_id.
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
In my form's text box I have noticed that I can;t write paragraphs ie use the TAB key to start a new line. If I use rich text I assume this will be possible. But are there any disadvantages to using rich text?
I am fairly new to VBA and am trying to apply a filter within a form so that agent records can be filtered based on an agent's name (so that they can only see information that refers to them).
I also want a record to be removed when it has been completed (when this habbens a date completed field will populated) however I do want to see those completed records that refer to the agent that have been completed today.
Here is my code. The 2 filters work on their own howver when I put them together I get a mismatch error.
If Me.txtRole = "Agent" Then DateCompletedFilter = "(DATECOMPLETED Is Null) Or (DATECOMPLETED = Date())" AgentFilter = "CASEOWNER ='" & Me.txtName & "'" DoCmd.ApplyFilter , AgentFilter And DateCompletedFilter Exit Sub End If
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.
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 have a column which contains "text digit text" as "AAA 222 BBB". The numbers of letters or digits can vary.
I need to SELECT the column which contains digits in a specific interval. For Example I have "DFS 673 JKK" "A 3454 LJLJ" "SD 854 JKLJD"
I need to SELECT the column which contains 600 < Digit < 700 the result of the query in this case would be "DFS 673 JKK" because 673 is between 600 and 700.
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?..
Is it possible to use find and replace to modify text in report design - or else is there something else I can do to get the same effect? I have a really useful report and I want to modify it for use with a different dataset. To do that I will need to change the text in over 150 text boxes. I have seven different fields which each occur over 20 times in the control source formulas in the text boxes, because they are used in different ways in different calculations. If this was excel I could do a simple find and replace to change e.g. every reference to fieldname OLD to fieldname NEW, but I cannot see how to do that within access report so am haveing to click on each text box in turn, go to properties and edit the text box .
I am trying to switch to a more general naming system in the modified report so then I will be able to assign data with the required fieldnames for the report within a query. But the report I am starting with has field names based on years 2013, 2014, 2015 etc.I want a quick way to change each reference to those field names to my more generic new field names.
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.
Is there a way to make just part of the text in a text box bold, or to use different font sizes in the same text box?
Something like this:
--------------------------------- Heading in bold: description in regular (not bold) (a smaller height line used as a line space) Another "normal" line a larger height line a normal line....all in one text box! ---------------------------------
One thing I'd like to be able to do is to specify the line height of a blank line in a text box. I'm using carriage returns created with: Chr(13) & Chr(10). I could see defining the font size of a hidden character, but I'd need to know how to assign a font size to a piece of the text in a font box.
how can i disable a textfield or two in a form when the textbox is unchecked also how do i add a default value for it while the textbox itself is disabled, can i get away with it by adding a default value on the textbox?
I have a form where I want a textbox [txtMaxOrdLimit] to be visible only if another text box on the same form [PaNumber] contains the letter D in the string. This is the code I have on the forms On Current property but I'm missing something because textbox [txtMaxOrdLimit] doesn't show on the form at all.
If Me.PaNumber = "*D" Then Me.txtMaxOrdLimit.Visible = True Else Me.txtMaxOrdLimit.Visible = False End If
I receive mails through LN and loop through a certain folder, reading DeliveredDate, Body, Subject and writing those items into an Access-table.This works fine, before I go for the loop I put the doc in another folder and remove the current doc from the folder.
Call LNDoc.PutInFolder("SMSBackup", False) Call LNDoc.RemoveFromFolder("SMSResponse") Set LNDoc = LNView.GetNextDocument(LNDoc) Loop
Without any error, without anything abnormal in the mails the code exits after a few loops, sometime after more or sometime after less read mails.The problem ist the RemoveFromFolder, not the PutInFolder function.
So to avoid this behavoir, I changed my code to finish the loop without Call LNDoc.PutInFolder("SMSBackup", False) Call LNDoc.RemoveFromFolder("SMSResponse")
and added after the loop a NotesCollection which should do ALL at once.But this part of the code does nothing at all (allthough found on the web).
With LNCollection .PutAllInFolder "SMSBackup", False .RemoveAllFromFolder "SMSResponse" End With
The complete code looks like this:
Set objNotes = GetObject("", "Notes.NotesSession") Set LNdb = objNotes.GetDatabase("myServer", "MyNSF") If Not LNdb.IsOpen Then LNdb.OpenDatabase If Not (LNdb Is Nothing) Then Set LNView = LNdb.GetView("SMSResponse")
I have a text source file and inpul layout i.e. field names start and end positions in excel file. I want create a table in access from the text data using excel file layout.
Can you please help me out in this. I am a mainframe programer and recieved an request to work in access.
I have a report that lists incidents for a specific day (reference number, a brief description and a few other fields). There is also an additional notes field, which I would like to be viewable from within the report.
For example, as a tooltip when the mouse hovers over the brief description text box. Or displayed in a textbox on the right (I don't want one textbox per line though, but instead a single re-usable textbox). Or a more information button/link that shows a "popup" containing the additional notes. I don't want to exit out of the current report, but stay within it.
I have tried to achieve this with a tooltip, but in fact even when I manually typed in a tooltip on the control's properties it wasn't displayed when I hovered over the text box.A pop-up or floating textbox would be preferable.