Forms :: Change Combo Box To Original Value?

Jun 11, 2014

I maintain a large database of employees. I have a form with a combo box (cmb_department) which I can use to select a particular department. I have written an After Update event procedure which updates the relevant fields on the form after I've selected a department - e.g. their new manager's name, phone number, etc. based on my departments table.

Here is my code, which works well:

Private Sub cmb_department_AfterUpdate()
If (Me.is_leaver = "" Or IsNull(Me.is_leaver)) And (Not IsNull(Me.employee_number)) Then
MsgBox "This member of staff is an internal HEY employee. Their departmental details will not change to that of the department, however they can still be set up with GP Browser access."

[Code] ....

However, I'd like to do two things which I'm currently unable to get working...

1. If I delete the department name from the box, or select a NULL value, I get a VBA error - run time error 94, invalid use of Null. I will sometimes want to select a Null value to "unassign" a person from this particular type of department but I'd like a way of selecting a Null value and having it simply set to Null which if the form's default value for this field.

2. As you can see I have a MsgBox which checks to ensure you want to overwrite the existing data for the member of staff. If I select Yes then it overwrites. If I select No I'd like for it to set the value of cmb_department back to the PREVIOUS value. At the moment my script sets it to NULL which doesn't really work - for example, say someone is currently set to the Sales department, and I accidentally click to change them to the Warehouse department, I'd like clicking "No" to revert them back to Sales...

View Replies


ADVERTISEMENT

Move Record To New Table After Data Change In Combo Box Value In Original Table.

Nov 24, 2006

Ok my problem is this......

I have a form with a field "Property Status" on it. It has 4 possible values -

"C - SHELTERED (with warden charge)";"H - SHELTERED (No warden charge)";"J - WHEELCHAIR SHELTERED (With warden charge)";"M - WHEELCHAIR SHELTERED (No warden charge)";"X - DISCONNECTED"

When the value "X - DISCONNECTED" is selected in the form I want the record to be removed from its existing table and sent to a new table which keeps all the "X - DISCONNECTED" records together.

Any ideas would be greatly appreciated. How would this be coded?

View 1 Replies View Related

Forms :: Change Record Source Of Combo Box On Form Based On Another Combo Box

Mar 31, 2014

I have a form that currently uses a "catch all" table for listing available equipment to choose from for an equipment field. I call it tblEquipment. What I want to do is to make it so when I type a name in (1 of 35) in one field of the current record, the record source for the equipment field immediately looks at a different table that has equipment available only for that name. To do this I plan on making 35 different tables with limited data originally found in tblEquipment. I would call these tblEquipment1, tblEquipment2, etc. I do not use a sub form, nor do I want to.

So my questions are:

1) can this be done
2)If it can be done, how can I do it?

View 3 Replies View Related

Forms :: How To Change Combo Box Headings

Feb 3, 2015

How can i change the combo box fields headings. by default it comes according to the table/query field name. I need to put some thing meaningful.

View 6 Replies View Related

Forms :: Change Field Depending On Combo Box

Mar 18, 2014

In the database, there is a table called "Jobs" which sales enquiries are entered into. In this table, there are fields called "JobStatus" which has the default text of "Quotation Pending" and a combo box "JobLive" which is a "yes/no" field. Normally a job will come in as quotation request and the "JobsLive" field will be set to "no".

Occasionally, a job will come in as confirmed from the outset. In this case, the job will be marked as "live" in the combo box "JobLive". Is it possible to change the "JobStatus" field to "Job Live" when this combo box is changed to "yes"?At any other stage, the "JobStatus" field will be changed using an update query as and when changes are made.

View 11 Replies View Related

Forms :: Change The Value Of Yes Or No Record Using Combo Box And Command Button

Aug 1, 2013

What to do, I have a form that will reset online user of my system the field is yes or no type boolean and i using combo box that will show only online people but my problem is how to reset the yes to no when i choose from the combo box a username I want to logout. I use command button also.

View 1 Replies View Related

Forms :: Change Display Of Field Values On Combo Box

Feb 17, 2015

I'm trying to sort and filter a continuous form. I want to sort by descending and ascending, but I also want to have a combo box for filtering. For example, there a combo box for sorting with Value List as the RowSourceType, the list would be "Ascending" and "Descending", and there should be another combo box to choose the field to be sorted with RowSourceType as Field List from a query.

My field names are: "LastName", "FirstName", "MiddleName". But I want them to appear as "Last Name:, "First Name", "Middle Name". I want to be able to change the display of the field names within my combo box which should come from my query. How is that possible? I already tried to put caption in the properties but it didn't work.

View 6 Replies View Related

Forms :: Change Items In A Combo Box Based On A Field

May 29, 2014

So I have a combobox that pulls values from a table. I am being requested to do an update to the database which means that I have to filter some values on that combobox based on a field on a previous form.For example:The main form is called "frmcontacts" and has a table field called "txttypeofcustomer" which can have two values: "customer" or "dealer".

The form that contains the combobox is called "frmnewissue" the combobox is called "cmbissuetype". "frmNewIssue" is opened through a button on "frmContacts". This combobox pulls the values from a table "tblissuetype". The values in that combobox are then: "Repair" "Return" "Question" "Replace".

If the value on txtTypeofCustomer is "Dealer" then all the values for the combobox remain visible. If the value of txtTypeOfCustomer is "Customer" then "Replace" cannot be visible or has to be greyed out.

View 6 Replies View Related

Forms :: Change Combo Box To Text Box - Show Unbound Column Value

May 28, 2013

How to change a combo box to a text box control in a subform for a field that is based on a two-column value list. I want to be able show the value in the unbound column (which is a text value instead of a number).

My subform has a field called "ProjectStatus". This field is a value list in my projects table with the following row source:

1;"Built";2;"Unbuilt";3;"Active";4;"On Hold";5;"Completed (Master Plan)";0

So, it is set as a two-column value list with a number data type for the bound column. In my forms, column 1 is made invisible (set to 0") so that only the text value is shown to the user. This works fine with combo boxes.

However, I want to change the unsightly combo box to a text box and show the text value of the unbound column (this form will only be used to show data not for entry). When I change it to a text box control, the value that appears is a number, of course.

If ProjectStatus were based on a table, rather than a lookup value list, I would query it but I am not sure how it should be done with a value list. I could just store the text value instead, I guess, and redo a bunch of stuff or I could create a "Status" table and redo a bunch of stuff (this seems like my lot in life lately) but I feel like there should be some way to do this.

View 6 Replies View Related

Forms :: Image Change Based On Combo Box Selection On Form

Jun 21, 2015

I have been looking some information on changing image based on form combo box selection on form.

I manage to do case by case but i need it in a simple code because their will be many employees just to avoid adding case by case code for each one.

Private Sub Emp_IDCombo_AfterUpdate()
Select Case Emp_IDCombo.Value
Case "AM-001"
Imageholder.Picture = "C:UsersAMGDesktopam-001.jpg"
Case "AM-002"
Imageholder.Picture = "C:UsersAMGOne DocumentsHR & Admin DatabaseEmployee Picturesam-002.jpg"
End Select

I have employees table where all images location is saved in text field and i have a combo box on form which is employee id.

Tables relationship
Employees_table [PK] to Contracts_table [FK] via field name {emp_ID}

Fields Name
Combo Box name on form Emp_IDCombo and row source is SELECT Employees_table.Emp_ID, Employees_table.EmployeeName, Employees_table.Emp_Pics FROM Employees_table;

Text field is located in employees_table called [Emp_Pic] for images location.

View 10 Replies View Related

Forms :: Change Form Details Based On Two Combo Boxes

Jun 12, 2014

I have two combo boxes in the form header and command buttons in the form detail. The combos allow the user to select either a customer or a prospect, then the command buttons open forms that only show records pertaining to the customer or prospect selected. Combos are "4Custcbo" and "4Proscbo".

1.How do I change which command buttons are available depending on whether the user has selected a customer or a prospect? Do I use two different subforms or is there a better way?

2.How do I hide the other combo box once the user has selected either a customer or a prospect?

View 3 Replies View Related

Change Combo Contents Based On Previous Combo Selection

Oct 20, 2005

Hi everyone,

I have two combo boxes on the same form bound to a table. I want the contents of the next combo box to change based on the previous combo selection e.g

cboContinent cboCountry
Africa Zambia
Africa Congo
Africa South africa
Europe England
Europe Holland

If I choose Africa in cboContinent, I want to see only Zambia, South Africa and Congo under cboCountry and if I choose Europe I want to see only England and Holland

Thanks
Humphrey

View 1 Replies View Related

Forms :: Change Button Color After Data Change

Apr 5, 2014

I am trying to change the button color on a subform if a related form data changes.Main form is products with a continuous subform with serial numbers of products i.e, serial number, location, price and a button to add addtional issues if there are any for this particular serial number (this will open up another form related to the serial number so I can add an issues if there are any).The reason I would like the button to be a different color is so I can quickly see if there are any additional notes been added to the serial number. Just in case you may ask why not add the field to the continuos form is that the issues and be quite lengthy and there may be lots of serial numbers on the form

2346 location warehouse price 29.99 (button - green)
2347 location shop price 29.99 (button - red)

View 1 Replies View Related

General :: How To Reference Original Records ID

Apr 8, 2014

So I have a list of records in a continuous form. Within that record is a checkbox called GRT. GRT stands for Gross Receipts Tax, when it is checked I have an after update event that adds a new auto-generated record for the GRT entry. The new record copies the date from the origional record, calculates GRT from the origional records amount field and some other things like that to create the new record. Creating the GRT record entry has went well.

But, if the user removes the GRT checkbox from, or deletes the origional record, I need to delete the corresponding auto-created GRT record. I thought I could do this by simply grabbing the origional records ID and copying it into the auto-generated records field called "AssociatedID".

Problem is, when I reference the origional records record ID, it always comed in as "-1". I can display the ID on the form and it shows correct, but if I msgbox the records ID, it shows as "-1". I cannot figure out how to capture the origional records ID so I can insert it into the new auto-generated record so the two records are linked so I can later use that link to delete the proper associated record.

How do I reference the original records ID.

View 4 Replies View Related

Deleting Duplication But Keeping Original

Jun 12, 2013

I would like to execute a code to remove the duplications in the MS Access Query but keeping one one data of the duplications.

For example, in the below data, I want to check for the data in the column Part No. The part number 123 and 234 are repeated twice so I want to delete the part no 123 and 234 that repeated second time and keeping the one data.

I'm complete new to MS Access.

Part No
Carline
Data
Call
123
BMW
1
1

[Code]...

View 5 Replies View Related

Click Thumbnail Image To View Original?

Dec 26, 2006

How can I enable a user to click a thumbnail image or other object on a form that will open the bigger orginal image file in a separate browser window (or other photo viewer)?

Thanks,
bugleboy

View 6 Replies View Related

General :: Can't Copy A Form When Editing The Original?

Sep 19, 2013

In A2010 I maintain a database originally created in A2003. The original version was locked down tight. In A2010 I struggled to do the same but got there in the end, as well as allowing me a back door way in.

Now I have an unexpected problem - in the object browser (or whatever it's called) on the left hand side I can no longer copy any object. EG, I want to copy a form for safe keeping while I edit the original.

View 5 Replies View Related

Concatenated Fields And Writing To Original Table

Nov 3, 2014

I concatenated 2 fields CR_Numbers: = CR_Number & [Sub Number] to display 12.01: from 12 and 1. I am now wanting to lookup the CR_Numbers to edit or add information into other fields.

I want to use a pop up form to edit/add data without having the form add an entire row to the table. How do I reference the Table ID so that it will go to the equivalent row to add the data in?

Main Table = Change Request
Email Table = AORB_Email
Fields in Form!AORB_EMail: Change Request (CR_Numbers), Priority (Pri_Name), Hours (Hour)

I plan on using the Priority and Hours in the email to set some dates and expiration times as well as in the subject of the email. I have figured out the email setup, and if I manually fill in the Priority and Hours fields everything works as it should.

View 14 Replies View Related

Combo Box Value Needs To Change With Record...

Sep 22, 2005

There are two main methods of navigating around the top-level form on the database I am currently working on.

One is by a drop down menu listing GP practice names - so you can scroll down to "Dr Watson" for example and then all the subforms display the correct info.

The second way is by clicking on "Previous Surgery" or "Next Surgery". This is obviously a lot easier for data entry than having to use the drop down menu each and every time!

However there is a problem, in that when one uses the second method - the highlighted value in the combo box does not change! You can literally navigate through hundreds of surgeries, and though the address changes in the subforms etc "Dr Watson" is still proudly displayed in the combo box.

So we have a situation where it would be pretty easy for someone entering data to think they were on the correct record when in fact they were not, leading to errors in input.

Is there a way to force the combo box to "refresh" to the same value as the current record, effectively displaying the title?

Thanks
Gazz

View 2 Replies View Related

Using A Combo Box To Change Records

May 16, 2006

Hi all,

I was wondering how would we change the forms row source everytime a new new item is selected in a combo box.

For instance here is a table:

ID Name Status
1 Joe Active
2 Fred Inactive
3 Sam Inactive

So if the names were to be displayed in a combo box and the status is represented by a option group. How could I make the combo box change the record instead of having to use the record selector

Any help would be appreciated

thanks

View 3 Replies View Related

How To Change A Value With Choice In A Combo Box

Oct 21, 2013

i have a two column that one stores a professions and other stores a number of the profession like that:

number
professions

1
singer

2
police man

3
teacher

"number" column is a combo box, that boundColumn property is two.

i want that in the form when i choose a value in a combo box i will see the profession in other text box in my form.if i choose 2 in combo box i see in a other text box in my form police man.

View 4 Replies View Related

Changing Recordsource Then Go Back To Original - Query Is Faster

Oct 11, 2006

Hi
I have some drop downs on my form, which has some code that decides which recordsource to use.
When I first select an option from the drop down, the query takes 10 seconds to load data.
I then select another option, which runs a different query, which takes x seconds.
If I then select the original option from the dropdown, the data loads onto the form in less than a second.

Why is there a delay the first time round and not the next? Has Access saved some kind of query plan? If so, why doesn't it save it permanently?

View 1 Replies View Related

General :: IIF Syntax For Returning Original Character If False

Apr 9, 2013

I have an access query where i want to write a syntax to return US if my table field is blank, but return the original field characters if not blank

this is what i have so far, not sure how to specify return original characters if not blank?

=IIF (JOBSITE COUNTRY=BLANK,"US", )

View 1 Replies View Related

How To Import Data From The Original Two Tables To New Updated Database

Apr 28, 2014

I've been making small changes here and there to my database in Access 2013. I have left the original database in place and it has acquired many new records from the last month. I'm ready to start using the newly updated design version of the database, but I do not want to have to type all those new records into the new database to get it up-to-date. There has to be a way to import the data from the original database to the newly updated one.

Most, If not all of the fields have the same names, but some of the fields have changed, like to Combo boxes. I removed two or three unneeded fields, and added two or three. I understand the new fields will need to have data enter to them, but the remaining would be redundant and inefficient if I have to reenter all the recent records again.

How do I import the data from the original two tables to the new updated database? I only have two tables and they use a One-to-One relationship in both databases. The table's names are different, but as I mentioned earlier, the fields are mostly the same. Do I need to import into Excel, and then modify the data slightly, and then import into my new database?

View 2 Replies View Related

Change Text Color In A Combo Box

Feb 5, 2006

I have a report card program that I use in my classroom. The program calculates letter grades for various sub categories.

For example, under the Primary Category Math, the computer will calculate a letter grade based on assignment scores and place the grade into a combo box for the sub category "Able to use a graphing calculator."

If I override the grade the program calculated for a student, I would like the text in the combo box to change to red for that student only. Then I can go back and quickly see which grades I have manually changed.

I just cannot seem to figure out the logic to use VBA that would check to see if a user has changed individual combo boxes.

Thanks ahead of time for any ideas.

View 2 Replies View Related

Change Color Of A Combo Box...dynamically

Sep 28, 2006

What I want is in the combo box, I have a couple of options, say 1,2 and 3.
And I want the combo box to come up with different color when different option is selected.

I thought I have found out a way, with the following code to onClick:

If me.field.text = "1" Then me.field.backcolor = 255

The problem is, it's being shown on a continuous form.
And it changes the color on all the records. not just the one I am on.

Any thoughts?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved