Editing A Specific Text Box Depending On A Number
May 2, 2013
I want to edit a specific textbox depending on a number which is dependent on a number of things and varies each time the form is run.For example, if the number is 0 I want to edit tb0.value. If it's 1 I want to edit tb1.value etc. I have specifically labelled my text boxes in this way.I thought something like this would work
textBoxName = "tb" & number
textBoxName.value = "this is the value I want to enter".
However, this does not work and it produces an error saying 'Invalid Qualifier'.
View Replies
ADVERTISEMENT
Mar 4, 2014
Code:
Private Sub Text74_AfterUpdate()
Me.Text1280 = Environ("UserName")
If Me.Text74 = "MACGH" Then
Me.Text89 = "PureGene"
Me.Text85.Value = Date
End If
End Sub
Is there a way to insert a line of code in the above that would add the next number to a 2 specific textbox's (Text103 and Text509)? Maybe if a table was created with all possible values and then the code would reference that table. There is probably a better way though. An example would be, if record 1 is A1 (in Text103) and 1 (in Text509), when record 2 is entered Text103 would be A2 and Text509 would be 2. Record 3 would be A3 and Text 509 3.
View 2 Replies
View Related
Nov 4, 2013
I have a form where we fill in information for supply of equipment to employees.
Each item must be signed for on a printed report.
I am encountering problems trying to create enough rows in my report detail for each signature of the items supplied.
For example, on the form I will select the "equipment" - 4 hats supplied and 3 boots. On the report I want the equipment set as the group and the detail to be a number or rows which equals the number of selected items. therefore under the Hats group heading I want 4 blank rows which are made up of 3 text boxes - Print Name, Signature & Date and another group heading for boots but with 3 lines.
View 11 Replies
View Related
Sep 18, 2006
Hi,
I'm trying to get the maximum number in a table field to increase it by one depending on the member that is selected in a drop down in a field.
I have three tables: members, programs and times. Each member can have N programs and each program can be broadcast N times.
Each member has a three digit code, like XXX. Each program has the three digit code of the member + three numbers that are supposed to auto increment. That is, the first program of member X with the member code XXX is called XXX001.
What I'm trying to do is that when a new program is filled in and I select the member, then the program code should update automatically, adding one to the latest program by that member.
That is, if the last program by member X that was inserted in the database is XXX010, then if a new program is inserted it should automatically be XXX011, even though programs by other members have been added in between.
This is the code I use now, for the AfterUpdate when selecting the member in a dropdown in the form. But although I've played around a bit, I just get error messages...
Private Sub medlemsruta_AfterUpdate()
Dim medlemskod
medlemskod = Me![medlemsruta].Column(2)
Dim strMax As String
strMax = DMax("programs_kod", "table_programs", "Left$(programs_kod, 3) = medlemskod")
Me!program_kod = Left$(strMax, 3) & Format$(Val(Right$(strMax, 3)) + 1, "000")
End Sub
Medlemsruta is a dropdown where one selects the member from the members table, where the three digit code is in the third column (Column(2)).
I'm trying to use DMax to get the maximum number for the particular member and after that adding 1 to that for the new program code.
Grateful for any advice! Thanks!
View 3 Replies
View Related
Jun 2, 2013
I am in the of designing an access 2010 database for data entry. Is it possible to create a button on a form in which a prompt asks a user for which records to export. Then depending on the entry export specific fields (First Name, Last Name, DOB) to a specific excel 2010 workbook (setup) and worksheet (template)?
For example, if the user entry is 1, only record 1: First Name, Last Name, DOB is exported to the setup.xlsx (more specifically the template worksheet of the setup.xlsx). However if 2,3,4 are entered then records,2,3,4: First Name, Last Name, DOB are exported to the setup.xlsx (more specifically the template worksheet of the setup.xlsx).
View 1 Replies
View Related
May 28, 2006
Hi Everyone
I have been searching EVERYWHERE, but was unable to locate even the correct wording of my problem, so I decided to see if there is anyone here solve this riddle for me:
I have a simple table with 2 fields
ie :
NAME NUMBER
George 5
John 3
etc...
I have the need to make a report that makes stickers and make 5 stickers with the name George on it and 3 with the name John etc...
I cant even think of a query that would produce 5 rows of George followed by 3 Johns (;})..
The actual problem is more complex than this ( many times ) but this is what is holding me back atm.
Thanks in advance people, and I would like to say that I have learned VERY VERY MUCH from this site alone , and within a month from starting to learn Access for the first time, I have succesfully made a database that is working just fine for invoices and keeping track of inventory....
View 2 Replies
View Related
Jul 8, 2015
how to read a specific line in a CSV file (using VBA), to see if the phrase "There are no records available." is present.
If it is present, then I'm going to do a debug.print stating that there are no records to load - and then the script will move on to the next file. If the phrase isn't present, then I'm going to upload the file to Access, parse the information, and then upload it to a CRM. (I already have the latter portion of the code up and running....I just need to account for the first part, where I can determine if the file has data or not).
The structure of the file never changes. The first row is composed of eight column headers (Post Date, Card Number, Card Type, Auth Date, Batch Date, Reference Number, Reason, Amount) and (if) the phrase "There are no records available." is present, it will show up on the second row, in the first column (under Post Date).
View 3 Replies
View Related
Apr 24, 2013
Access 2013 stops working when I open any table in design mode, and select any field with the type "Number". I can edit Text, Date or Yes/No fields, but not Number ones.
View 7 Replies
View Related
Oct 5, 2005
I have a report in an Access file that someone created for me. I have
NO real experience in Access, it was all done for me, and now I want
to do some editing.
What I have is a letter with "letter head" at the top (text box 1.) This text is centered.
The date (text box 2),then body of the letter follows in the main
larger text box 3. This text is left justified.
When our Principals change I need to change the first text box sometimes
this means there are more or less lines in this box. I have done this successfully, although I'm not sure if it was "correctly" I have replaced names, and made the box smaller to get it to wrap so there is the correct amount of text (Name) on a line. I'm not sure what I would do if I had a line that I don't want to wrap that is longer than the line I do want to wrap. but that is working for now.
The first thing I'm trying to do is put the date in the third larger
text box instead of a seperate box. To do this I figured I needed to
add a blank line before the first paragraph of the 3rd text box, then
enter the current date code. I tried to copy and paste the code from
its current seperate box and paste it into the third box, but then the
report only shows the code/no date and the following paragraph isn't
aligned properly since the only way I could figure to move it down was
with spaces. I tried ctrl/enter, and that just gave me some pop up
dialog box with some tools in it that I don't know what to do with.
The second thing I wanted to do is bold only part of the text in the
large/3rd text box.
Some how I ended up with some blank space between 2 paragraphs so what
I did to get the bolded text paragraph I want is add another text
box, bold it and place it on top of the existing larger text box, but
I always have to move the 2 boxes (3 if you count the date) when I
need to shift the text up or down for any adjustments I do in the
first box. Is there a way to only bold one paragraph of a larger text
box?
I have tried different things, and I have searched "help" as they like to call it, but it is NOT!
I hope this is clear.
TIA
Susan G
P.S. I have tried different things, and I have searched "help" as they like to call it, but it is NOT!
View 3 Replies
View Related
Jan 31, 2006
I have a text box that I only want people to add new data to. I would like them to be able to view previously entered data but not able to edit it. I've tried to lock the data but then I can't add new data.
Any suggestions appreciated,
Joe
View 1 Replies
View Related
Feb 14, 2007
Hello,I have been examining an Access application and it has menus and several menu items under the headings of those menus. (I could call them as well "Application-Specific menus" as they contain shortcuts to the forms inside the application, such as "Offers>>Prepare a sales offer" , "Definitions>>Customers & Locations" , or "Definitions>>Series & Models" and so on...)In View>>Toolbars>>Customize, selecting the checkbox of that menu,I can make those Application-Specific menus appear also in design mode.So far so good, but....if I'm able to make them appear in design mode, I should also be able to "edit" them, right? But I simply can't edit them.For example, I can't seem to pull the menu item "Definitions>>Customers & Locations" and put it under the "Offers" menu. (so that a new item called "Offers>>Customers & Locations" is formed)Well as an Admin, I 'm supposed to do it, as one the users suggested that it be more effective if the menu item "Customers & Locations" stood under the "Offers" menu.So, how can I edit my "Application-specific" menu items? Thanks.
View 5 Replies
View Related
Dec 20, 2014
I am trying to create a report that has a header ( all ok ) then could have 1 or 15 detail lines ( all ok ) which contain cost for each line
then I have a footer with the subtotals of the costs and also bank details
then I have footnotes
What I need the report to do is keep the subtotals, bank details and the footer notes at the bottom of the page all the time weather I have one detail line or 15 detail lines
What is happening at this time is the footer information is moving up or down depending on the number of lines I have.
View 14 Replies
View Related
Dec 18, 2014
I am trying to save specific data from a data entry form to a specific depending on what the user selects from a dropdown/combo box.
So if the user selects "test company from the combo box, that data (from that form) will save to the Test company data table.
View 5 Replies
View Related
May 24, 2006
Hi,
I am building a stock control database. I have a form called [products]. On this form are two fields. One called [ProdReorder], the other [UnitsOnHand].
[UnitsOnHand] is displayed form a subform called [ProductsSubform].
What I want to know is: What code would I enter (& where) so if the [UnitsOnHand] value is less than the [ProdReorder] value it will display the value in red?
Eg: Reorder value is 5
I have 10 motors on stock (UnitsOnHand) = Text is black.
If I have 4 motors on stock = Text is Red.
How can this be done? any advice welcome. PS. my vba skills are weak.
View 2 Replies
View Related
Mar 30, 2014
right I have auditing system in my database that tracks any changes made to any records. it logs it on a separate table and i show it on a continuous form.
right my problem is that I have loads of check boxes and text boxes on my main form on the form that records the main form I have a field call "new value" this is a text box but if I change a checkbox on the main form it will show -1 or 0 in the new value field on the recording form but I would like it to say yes or no I have tried the following
Code:
Private Sub New_Value_AfterUpdate()
If [New_Value].Value = -1 Then
[New_Value].Value = "yes"
End If
End Sub
this only works if I enter -1 manually but the data is entered automatically after the record is saved on the main form ...
I have also tried on enter before update I get error but now I need it to change on new entry...
View 8 Replies
View Related
Jul 10, 2007
Hi all,
I am trying to have the rowsource change on a "subcategory" combo box depending on what the "category" combo box says.
I added an event procedure to the "Category" combo box which changes the Row Source in the subcategory combo box to something else. I'm not sure that I did this right as if I close the database and reopen it, what I selected in the subcategory combobox is gone and it is blank. Any ideas? Here is my simple, likely incorrect event procedure:
Private Sub Category_Change()
If Category.Text = "Rare Books" Then
SubCat.RowSource = "scRareBooks"
End If
If Category.Text = "Legal Documents" Then
SubCat.RowSource = "scLegalDocuments"
End If
End Sub
Thanks!
View 5 Replies
View Related
Aug 19, 2005
I realize there are several threads already dedicated to this particular topic but my situation is slightly different... First, my tables are set up like so:
tblStudent(studentID,LName,FName,MI,Gender)
tblRack(rackID,roomID,studentID,rackNumber)
tblRooms(roomID,roomNumber)
There are 3 racks to a room and a total of 90 rooms. A room can hold up to 3 students. A list box holds values that I have typed in (the room numbers). I went with typing them in rather than pulling them from a query because of the way my tables are set up. If I pull from a query as the tables stand, room numbers show up 3 times, once for each rack. I want to be able to fill in text boxes with information on students assigned to the room I choose from my list box (FName, LName, etc...) I'm kind of at a loss here on how to go about getting the info that I want. Using the column property to populate text fields is probably going to be much easier but a query is needed (I think) and using a query causes room numbers to show up 3 times in my list box... Anyone want to throw me a bone?? Thanks! :)
View 2 Replies
View Related
May 5, 2005
:) Hello
Is it possible to change the colour of the text in a table. For example the word "URGENT" is selected from a combo box, and when viewed in the table it appears red.
Thanks inancipiation
Woozie
View 1 Replies
View Related
Jan 9, 2014
I have a box with age in called [agecalc]. I want to change the border of the box to red to indicate they are a Juvenile if under the age of 17.I already have some code to write the text, I just need to change the border of this text box called agebox
=IIf([agecalc]<=17,"Juvenile!!")
View 1 Replies
View Related
Aug 6, 2013
I want to display the text from one combo in a text box in another form based on what's selected in a second combo box. The text box is in a different form from the combo boxes.
Sub D_ComponentTypeCmb_Change()
If Me.D_ComponentNameCmb.Value = "Customise" Then
Forms!CustomComponentF!C_ComponentTxt.Value = Me.D_ComponentTypeCmb
Else
Forms!CustomComponentF!C_ComponentTxt.Value = ""
End If
End Sub
View 13 Replies
View Related
Jul 27, 2014
I have a report that displays on a continuous style report. What courses the employee have been on and when they expire
right I have field call expirydate and another call dayover showing the number of days till that course has expired also I have made a label called Expired1
now what I'm trying to do.....
if the expirydate has passed I want the expired1 label to be visible and dayover field to become invisible
I have tried
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Expirydate < Date Then
Me.expired1.Visible = True
Me.DaysOver.Visible = False
End If
If Me.Expirydate > Date Then
Me.expired1.Value = False
Me.DaysOver.Value = True
End If
I have also tried the code on current event on the report
now my problem if one of the course has expired it will show the label called Expired1 but on all the records but I only want it to display on the record that has expired and leave the daysover text box visible if course has not expired
View 7 Replies
View Related
Jul 13, 2013
In Access 2007 (or 2010 , 2013), in a continuous form, I want to change the background colour of a text box depending on its value. Obviously, for each record, the color can be different.
View 1 Replies
View Related
Jul 28, 2014
I have a report that prints labels (similar to avery labels) which pulls data from a query. These labels are all unique and vary in length. Due to the length variance, I want the font size to get smaller for labels with more characters. I want the text to go down to another line when necessary.
In my report under the OnPage Event Procedure I wrote this:
Private Sub Report_Page()
If Len(Text2) > 20 Then Text2.FontSize = 8
If Len(Text2) > 10 And Len(Text2) < 21 Then Text2.FontSize = 10
If Len(Text2) < 11 Then Text2.FontSize = 14
End Sub
This works to some degree but the problem is that once there is a longer label, all of the proceeding labels are resized & the longer label that should have been resized was not.
Is there another place I should be writing this code? I looked under events for the textbox but there doesn't seem to be anything that would work since none of them would trigger when printing labels
View 3 Replies
View Related
Nov 26, 2004
Date of Birth (DOB) field etc. in one program are text - how do I make another file with the same data into number fields for Date of Birth field etc? When I copy data to file that has number fields the 09252004 is changed to 9252004. Can I get reports with the correct Date of Birth in them by moving data from text file to number file?
There is data entered monthly in file and formula has been set up for January, February etc as ---quarter: Int(([month]-1)/3)+1. I would like formula for the fiscal year for April to be counted as month 1, May - month 2, June as month 3, July as month 4, August as month 5, Sept as month 6, October as month 7, Nov as month 8, Dec as month 9, Jan as month 10, Feb as month 11 and March as month 12.
Thank you
View 6 Replies
View Related
May 20, 2013
how to get a specific task done. My table has automatic ID in one column which is unique in each data entry row. There is another column which has "Batch Id" which might be repeated in some of the rows but most of the time it is unique value. I would like to get get an updated count of this "Batch id" from start to the point of entry of new entry to understand how many total batch ids entered to that point. I am open to do this in table if possible of by creating new query.
View 3 Replies
View Related
Jun 14, 2012
Is there a way to look at only data from a specific month? It's June now so let's say I want to look up only data from June without having to hardcore the number 6 or letters "June" in my query. How would I go about doing this?
Another question would be how can I convert this to a number to multiply the numbers in my data with?
So I want to retrieve only data for the current month, June, and then multiply numbers associated with that data with the number of the month for June (that is, 6). How would I go about doing this?
View 1 Replies
View Related