Code:
Private Sub Check253_AfterUpdate()
If Me.Check253 = -1 Then
Me.Text254 = DLookup("[Lot]", "[tblAutoGen]", "[Inuse] = -1")
Me.Text256 = DLookup("[Exp]", "[tblAutoGen]", "[Inuse] = -1")
Me.Text258 = DLookup("[Lot]", "[tblEthanol]", "[Inuse] = -1")
[Code] ....
I am using the code above on my form and it seems to be working. My question is there a way to populate a textbox (Text255) based off a login?
For example, lets say JSmith is loged in to the computer. Is there a way that JS could populate Text255? If then say JCarter is logged on, the JC populates Text255.
I am fairly new to Access and trying to populate a text box based on whether other textboxes throughout the form contain a date or are null, so as I update the progress of work the textbox that I have located in the header will indicate the status of work flow, this is what I thought might work but I seem to be doing something wrong.
Code: Private Sub Form_AfterUpdate() Status = IIf([Date_Raised] Is Null, "New", "") Status = IIf([Date_Raised] Is Not Null, "Open", "") Status = IIf([Approved_Date] Is Not Null, "Approved", "") Status = IIf([Actioned_Date] Is Not Null, "Actioned", "") Status = IIf([Tested_Date] Is Not Null, "Tested", "") Status = IIf([Closed_Date] Is Not Null, "Closed", "") End Sub
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?
I have a from based on a query. This form has a textbox called CUM_GPA which contains numbers in this format: x.xxx
In the After_update of CUM_GPA is this code:
Private Sub CUM_GPA_AfterUpdate() If Division = "GRADUATE" Then Honors2 = "" ElseIf Division = "UNDERGRADUATE" And CUM_GPA < 3.2 Then Honors2 = "" ElseIf CUM_GPA >= 3.2 And CUM_GPA < 3.5 Then Honors2 = "*" ElseIf CUM_GPA >= 3.5 And CUM_GPA < 3.8 Then Honors2 = "**" ElseIf CUM_GPA >= 3.8 Then Honors2 = "***" End If If Division = "GRADUATE" And School = "SCHOOL OF EDUCATION" And CUM_GPA >= 3.7 Then Honors2 = "+"
End If end sub
The textbox called Honors2 returns nothing. Any help is greatly appreciated.
I have a textbox on a report that I wish to populate based on the value that is in another textbox/field on the report, and I thought DLookup was the way to go - however, I cannot seem to get it to work.
I have a table (ComplaintsResponses) that has two fields, both text
[ShortDescription] [ResponseText]
The text from [ShortDescription] is saved in a field on another table that contains all the other relevant information that is used in the report, and whilst this short description is mostly fine, I have one report where I need the data from the larger [ResponseText] field.
I am building a form in access and I am trying to find a way where user input isn't possible in the associated textbox when "No" from on option box is selected.
I have a table filled with company contacts and form with a combo box containing the contacts names.
When a contact is selected I want it to show their Telephone, Mobile and email address in text boxes below. But it only shows the telephone number and the other two fields stay blank.
what I'm doing wrong ?
I have this code assigned to the combobox:
Code: Private Sub MainContact_Change() Me.Text169 = Me.MainContact.Column(3) Me.Text167 = Me.MainContact.Column(2) Me.Text177 = Me.MainContact.Column(1) End Sub
And this is the row source:
Code: SELECT tbl_Contacts.Salutation & " " & tbl_Contacts.ContactForename & " " & tbl_Contacts.ContactSurname AS MainContact, tbl_Contacts.ContactTelephone, tbl_Contacts.ContactMobile, tbl_Contacts.ContactEmail FROM tbl_Contacts WHERE (((tbl_Contacts.ID_Company)=[tbl_CompanyBookings].[ID_Company]));
I would like to create a combobox on a form in which a user has three selections: negative, positive, other.
If negative is chosen a textbox auto-populates with "none detected". If positive is chosen the text box populates with "positive" and If other is selected the text box populates with "unspecified".
I am looking to have a combobox on a unbound form to select a product code (this i can do). However I want a textbox to auto populate with the description as well - both in the same table tblproducts - product_id, pcode, pdesc....
Got a bit stuck in a database. I have a form based on a query. On the form I have 4 comboboxes.
The combo boxes filter eachother without a problem (based on custom select query)
Now I want after the fourth combobox value is selected, I want to populate a text field with a value from a different column from the master query (after the 4 selections only 1 value should be possible)
Master query contains 5 columns: - group - type - job - insurance - charge
combo1 selects group (and filters records) combo2 selects type (from remaining records and filters again) combo3 selects job (from remaining records and filters again) combo4 selects insurance (from remaining records and filters again)
Combo4 is based on following query: -column1 Insurance Total=Group by Show=yes -column2 Job Total=Where show=no Criteria [forms]![name].[combo]
This works great and the dropbox only shows 1 OF EACH DIFFERENT record
If I add a text box and want to see the "charge" value, that I thought I could use the ME.text-code. But in order to do this, I have to add the charge column into the query of Combo4.
If I do this, the dropbox for insurance gives me multiple values that are the same. Is there any way to make this work?
I am trying to populate a textbox from a field in a table based on clicking on a item in a listbox. User clicks a name from the Client table in the client field, and the date that is stored in the orderDate in the same row. I want the text11 textbox to show that date.
I'm working on a project that uses a barcode scanner. The user will scan a barcode which will choose an item from a combo box. The result of what it enters will populate a text box. I have that part working fine.
The next step is to get it to open a form based on the value in the textbox. The textbox will have about 7 different possible values and each one should open a different form.
The way this is supposed to work:
User approaches a machine and scans the barcode. He is presented with a form giving him options based on the type of equipment the machine is. A compressor for example would present him with a set of options for compressors (gauge readings, maintanence, etc).
I have an unbound form with two controls:
cboAssetNumber txtType
How to code this and which events to code it in. Users will be going from machine to machine and using the form over and over again so I need to somehow manage the clearing of the form to begin again with another barcode scan.
I saw another thread about a barcode scanner and one response was to program the scanner to send the barcode and then send an "Enter" press to move focus to the next control. I've looked through the documentation and haven't been able to find if that is possible. Right now it sends the number and that's it. It's a "Motion" Tablet.
I have a form bound to a table, with a subform in there, and I have a textbox with a source one of the table's fields. I would like the value of this textbox to be calculated based on the values of some boxes in the subform, but I also wont to be able to edit the value on the textbox myself.
Is it possible to have a textbox that get its value both from calucaltions and user input?
My table have orderid along with other columns, i want to create a form where i am having a textbox for order id input by user. Firstly when user sees the form its only with the textbox and table fields, when i put the order id in the textbox the listing should be made.
I would like to put a text box (user) and checkbox (check100) on a form, that when the checkbox is not checked the value in Gender switches. In an AfterUpdate I would use a code to capture the user login.
Code: Private Sub Check100_AfterUpdate() Me.User = Environ("UserName") If Me.check100 = 0 AND Me.Gender.Value = "Male" THEN Me.Gender.Value = "Female" ElseIf Me.check100 = 0 AND Me.Gender.Value = "Female" Then Me.Gender.Value = "male" End If End Sub
I have a form with a Count textbox. It's control source is a field named "Audit Count" in the table "DB Audits". The idea of the textbox is to display a running count of how many audits a specific auditor has completed that day. To do this I have the textbox set up with a default value of:
Assuming I'm using the DCount function correctly, this is supposed to count the number of [Loan Number] records entered in the "DB Audits" table by the auditor (whose name is found using fOSUserName()) on today's date. So, for example, when opening up the form at the beginning of the day the Count textbox would read 1 and when the auditor clicked Save and New it would increase to 2.
The problem I am having is something I encountered while doing some random tests of the form. If an auditor submitted an audit (let's say the 1st of the day), the form correctly displays the next count as 2. However, if the auditor were to delete the record from the underlying "DB Audits" table while the form was still open, if they were to enter a new record, the Audit Count field would display 2 even though it should be 1 (since the 1st record had been deleted).
How can I have the Count textbox refresh whenever someone deletes a record from the table while the form is still open? I tried a Requery command using the AfterDelConfirm event but I couldn't get it to work.
In ContactIDForm it contain 1 textbox name 'TextBox' with Button Name 'Btn'
In ContactIDForm there is only 1 Text Box ContactIDTextBox and 1 Button. User Enters ID in TextBox and On Button Click Event it should check data from TextBox in Table name (ContactDetailTable) in field ContactID and if there is record matching, ContactInfoForm should Open else NewContactForm should open with ContactIDTextBox value in it.
I have a new staff member in my office that has informed me that she has a degree of dyslexia. To assist her I've trialled changing the textboxes on one form in my Access 2013 application to a light pink color & this has instantly worked for her to read/input text.
Is there a way to automatically change each textbox to light pink on every form in my application on startup based on user login (say using an IIF statement in the OnLoad event of the startup form).
I am trying to populate the text boxes in a form with data from a table based on the selection a user has made in a combobox. I am trying to do this through a DLOOKUP in the text boxes Control Source using the following:
I'm using a sub form to display data form a table. The users wanted it display like a spread sheet. In order to get all the data to display on the same page I am trying to break some of the longer feilds out (i.e. comment field) and display them in a list/text box and not in the table with the smaller fields.
Basically what will happen is when a record is selected in the sub form the comment field tied to each record will be displayed below. I've tried a few things but I keep getting errors displayed in my list/text box (#Name?)
So I'm trying to populate a table based on selections I make within a form.
The form is based of a query that pulls a new product category that needs to be added to my first reference table for products.
The form shows all the new unique product codes, and there is a drop down box with product categories whose source is also the first reference table, so a new code would be:
'JBL - TRX - FVB - TRZ' And based on that new info, I would select from the drop down to select the corresponding category and click 'Add Record' button.
I'm building the event for the button and the code is as follows so far :
Private Sub Add_Record_Click() End Sub Private Sub cmbAdd_Record_Click() 'add data to table CurrentDb.Execute "INSERT INTO tblPVMTable(PVMJoinField, SummaryPVMCategory) " & _
[Code] ....
I keep getting errors with the main portion of code.
I have a form called frmPO based on a table called tblPO One of the fields in tblPO is linked to the field idAddress in the table tblAddresses
The following fields exist in both tblAddresses and tblPO Company Address1 Address2 City ZP State
The form contains controls for these fields on tblPO. I would like to give the user the choice to either enter a shipping address manually, or selecting a preregistered address from tblAdresses. For this I would like a combo box showing the values of idAddress. I f a user selects a preregistered shipping address, I would like the form to fill the rest of the fields based on the value of this control.
My understanding is that I should set a BeforeUpdate event to set the values of the different controls, unfortunately my command of VBA amounts to 0.
I have two tables: tblWeightTickets and tblWasteType.
I want to create a form: frmWeightTickets, where a user can enter information and the data is stored in tblWeightTickets.
There are two fields in particular that I am working on ... "WasteType" and "Rate".
On the form, I want "WasteType" to be a combobox "cboWasteType" and when I select a type of waste I want the "Rate" textbox on the same form to auto populate with the rate amount for that particular type of waste (i.e. recycling, garbage, etc).
The Rate amount is located in the table: tblWasteType under the field name "Rate". How can I do this and at the same time store the information in the tblWeightTickets? I already have the combo box loaded with the types of waste - I just need it to populate the rate text box and store it in the Weight Tickets table.